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)
- NPE happening in TCPMemcachedNodeImpl.fillWriteBuffer under heavy load
- Memory Leak in LinkedBlockingQueue in AsciiMemcachedNodeImpl/TCPMemcachedNodeImpl
- JVM crashed always with Memcached IO over
- NPE
- Allow to configure MAX_CLONE_COUNT parameter
- CASMutator.cas should throw typed exception
- read/write queues are not being cleared incase of faulty server:port, proposed a fix
- How to get more two values using get(key) API ?
- Broken link on "Project Home"
- Memcache sets taking unusually long time HOT 1
- Unable to read Binary data (C Struct) from Memcache HOT 7
- MemcacheClient with SerializingTranscoder isn't thread safe
- Very big performance issue with large numbers of asyncGets
- java.lang.AssertionError: Unknown line type: STORED HOT 1
- can spymemcached cause race condition?
- Missing CAS API (With exp. time and without Transcoder) HOT 1
- Booleans contained in Clojure maps deserialized as new instances of java.lang.Boolean - breaks "if" HOT 1
- Client never connects with small timeout (auth problem)
- getBulk() doesn't use FailureMode HOT 3
- Set request fails after restarting the server HOT 1
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.