Comments (9)
I've reproduced this. Thanks.
Original comment by [email protected]
on 14 Mar 2008 at 6:33
- Changed state: Accepted
- Added labels: Priority-High
- Removed labels: Priority-Medium
from spymemcached.
Actually, scratch that. I got a cancellation exception on the client, but once
I
caught that, the client continued to do the right thing.
Can you provide a small test case? This is what I did:
http://github.com/dustin/java-memcached-client/tree/master/src/test/manual/net/s
py/memcached/test/MultiNodeFailureTest.java
Original comment by [email protected]
on 14 Mar 2008 at 6:47
- Added labels: Priority-Medium
- Removed labels: Priority-High
from spymemcached.
I've found the problem is exception related. The following is what my test
case,
but if I put the get() into try/catch, it's working fine.
===============================================
String m_sMemcachedHosts = "localhost:11211 localhost:11212";
MemcachedClient mc3 = new MemcachedClient(AddrUtil.getAddresses
(m_sMemcachedHosts));
for (int i = 0; i < 50; i++)
{
long t1 = System.currentTimeMillis();
String val = (String) mc3.get("test");
long t2 = System.currentTimeMillis();
System.out.println("[" + i + "] mc3 test=" + val + " (" + (t2 - t1) + ")");
try
{
Thread.sleep(1000);
}
catch (Exception e)
{
e.printStackTrace();
}
}
Original comment by [email protected]
on 14 Mar 2008 at 8:33
from spymemcached.
OK, that's similar enough to what I've done.
I'm going to change this to a documentation bug and attempt to make it clearer
what
this behavior is.
Original comment by [email protected]
on 14 Mar 2008 at 5:03
- Changed title: Need better documentation on failure modes
- Added labels: Component-Docs
from spymemcached.
Sorry for thrashing this bug so much, but I just read the detailed report on the
list, and there's definitely something going wrong in my client.
Exception in thread "Memcached IO over {MemcachedConnection to
/127.0.0.1:11211}"
java.nio.channels.CancelledKeyException
at sun.nio.ch.SelectionKeyImpl.ensureValid(SelectionKeyImpl.java:55)
at sun.nio.ch.SelectionKeyImpl.readyOps(SelectionKeyImpl.java:69)
at java.nio.channels.SelectionKey.isReadable(SelectionKey.java:271)
at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:262)
at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:180)
at net.spy.memcached.MemcachedClient.run(MemcachedClient.java:730)
I'm not certain I can make this happen for me, but I should be able to expect
it and
make it deal with it a bit better.
Original comment by [email protected]
on 14 Mar 2008 at 5:12
- Changed title: CancelledKeyException while handling IO with a downed server
- Added labels: Component-Logic, Priority-High
- Removed labels: Component-Docs, Priority-Medium
from spymemcached.
Status update:
I was looking into this tonight, and I don't see how that exception should be
able to escape. The code in
question looks like this:
try {
[...]
if(sk.isReadable()) { // CancelledKeyException thrown here
handleReads(sk, qa);
}
[...]
} catch(Exception e) {
getLogger().info("Reconnecting due to exception on %s", qa, e);
queueReconnect(qa);
}
For my reference, the full report is here:
http://www.nabble.com/Re%3A-MemcachedClient-and-timeout-p16046771.html
Original comment by [email protected]
on 16 Mar 2008 at 8:02
from spymemcached.
I am seeing this, but I'm still using 1.4.
Exception in thread "Memcached IO over {MemcachedConnection to
xxx/xx.xx.xx.xx:11211
xxx/xx.xx.xx.xx:11211}" java.nio.channels.CancelledKeyException
at sun.nio.ch.SelectionKeyImpl.ensureValid(SelectionKeyImpl.java:55)
at sun.nio.ch.SelectionKeyImpl.readyOps(SelectionKeyImpl.java:69)
at java.nio.channels.SelectionKey.isReadable(SelectionKey.java:271)
at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:263)
at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:181)
at net.spy.memcached.MemcachedClient.run(MemcachedClient.java:715)
Original comment by [email protected]
on 28 Apr 2008 at 7:57
from spymemcached.
1.4 is quite old. I haven't done any work on that branch since July 2007. I've
fixed numerous bugs since then (which I believe includes this one).
Original comment by [email protected]
on 28 Apr 2008 at 8:08
from spymemcached.
I can't reproduce this and the code path I'm aware of suggests it's relatively
impossible, so I'm going to close this as invalid unless someone can get me a
test.
Original comment by [email protected]
on 2 Oct 2008 at 7:13
- Changed state: Invalid
from spymemcached.
Related Issues (20)
- State the dependencies in the pom file HOT 5
- Multhreaded implementation with SASL support not working. HOT 1
- Operation class is used in un-threadsafe, unsynchronized manner. HOT 4
- Inside TCPMemcachedNodeImpl, use direct buffers HOT 4
- Stability problems in async I/O HOT 4
- assertion failure during ConsistentHashingTest HOT 1
- incr/decr parameter "by" should be a long, not an int HOT 9
- Zlib encoding/binary access HOT 3
- getBulk() logs a warning when no keys are in the cache HOT 3
- bug in OperationImpl HOT 6
- get(long timeout, TimeUnit unit) may take longer than given timeout HOT 3
- IllegalArgumentException after Switching from SpyMemcached 2.7 to 2.7.1 HOT 2
- "unl" unlock operation is not implemented on MembaseClient HOT 9
- 2.7.1 jar for download corrupt? HOT 5
- Callback support HOT 11
- Get canceled HOT 5
- CAS operation fails due to client sign-extending the CAS value HOT 1
- warning for "handling node for operation is not set" if any server is down HOT 4
- javadoc warnings from tap and vbucket classes HOT 3
- CASMutator removes expiry on mutated items
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spymemcached.