xulunfan / memcached-session-manager

Automatically exported from code.google.com/p/memcached-session-manager
0 stars 0 forks source link

Windows only: memcached failover can break memcached client / connection #91

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
On Windows (tested with XP) a memcached failover (crashed memcached) can leave 
the memcached client in an inoperable state. spymemcached reports this as an 
Error (java.lang.AssertionError: IO Thread is not running.) which is thrown to 
the webapplication as msm doesn't handle this.

It's caused by the SuffixBasedNodeLocator throwing a NodeFailureException in 
getSequence.
spymemcached logs this as s.th. like "Exception in thread "Memcached IO over 
{MemcachedConnection to localhost/127.0.0.1:21211 localhost/127.0.0.1:21212}" 
de.javakaffee.web.msm.NodeFailureException: The node n1 is not available.".

Afterwards spymemcached refuses all requested work with
java.lang.AssertionError: IO Thread is not running.
    at net.spy.memcached.MemcachedClient.checkState(MemcachedClient.java:263)
    at net.spy.memcached.MemcachedClient.addOp(MemcachedClient.java:276)
    at net.spy.memcached.MemcachedClient.asyncGet(MemcachedClient.java:797)
    at net.spy.memcached.MemcachedClient.get(MemcachedClient.java:917)

It seems to be somehow related to 
http://code.google.com/p/spymemcached/issues/detail?id=10

It's only happening on windows, not reproducable on linux.

Original issue reported on code.google.com by martin.grotzke on 19 Mar 2011 at 10:33

GoogleCodeExporter commented 9 years ago
Will this also occur if tomcat running on windows and the memcached nodes on 
linux?

Original comment by Zoi...@gmail.com on 25 Mar 2011 at 9:10

GoogleCodeExporter commented 9 years ago
Yes, it's the memcached client (http://code.google.com/p/spymemcached) used by 
memcached-session-manager which has this problem, therefore it makes no 
difference where memcached is running.

The issue/reason shown in the stack trace above is already fixed in master and 
tomcat7 branch (commit 87be8d4f0c0c2786aaf4008e67379cf01aef5de8). This was 
actually a behaviour of msm which lead to this situation.

However, I'm not sure if perhaps there's still a potential problem on windows, 
as http://code.google.com/p/spymemcached/issues/detail?id=10 was closed as it 
was not reproducable by the developer.

I tested on Windows XP, and for me everything seems fine. As for Rainer tests 
still fail when running on Windows7 (according to the conversation on the 
mailing list, see 
http://groups.google.com/group/memcached-session-manager/browse_thread/thread/69
90be37d1a1020c/60d038bb6c397d89 ), I'm not sure what's the situation on such a 
windows box. As Windows is not free it's not possible to just download this and 
try to reproduce.
So if you're also seeing issues perhaps you can help analyzing this?

Apart from all this, I'd never recommend windows as a server machine, and as 
this problem does not occur (at least was never seen) on linux it's only a 
Windows issue. Of course it would be nice if msm could be developed on windows, 
but it's not a necessary requirement from my point of view.

As the concrete issue mentioned above is already fixed I close this issue for 
now, if you're still seeing issues please open a new one.

Original comment by martin.grotzke on 25 Mar 2011 at 9:30