GithubHelp home page GithubHelp logo

Comments (9)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 28, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 28, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 28, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 28, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 28, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 28, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 28, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 28, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 28, 2024
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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.