Skip to content

Instantly share code, notes, and snippets.

@oldratlee
Last active July 28, 2016 03:03
Show Gist options
  • Save oldratlee/5465971 to your computer and use it in GitHub Desktop.
Save oldratlee/5465971 to your computer and use it in GitHub Desktop.

多线程使用SpyMemcached Client

2013-04-26 17:16:00.017 WARN net.spy.memcached.protocol.binary.BinaryMemcachedNodeImpl:  Operation canceled because authentication or reconnection and authentication has taken more than one second to complete.
2013-04-26 17:16:00.019 WARN net.spy.memcached.MemcachedConnection:  Could not redistribute to another node, retrying primary node for test-toolkit-1366967755495.
2013-04-26 17:16:00.020 INFO net.spy.memcached.MemcachedConnection:  Reconnecting {QA sa=/10.249.194.159:11211, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0}
2013-04-26 17:16:00.034 INFO net.spy.memcached.MemcachedConnection:  Connection state changed for sun.nio.ch.SelectionKeyImpl@79de256f
2013-04-26 17:16:00.161 INFO net.spy.memcached.auth.AuthThread:  Authenticated to /10.249.194.159:11211
2013-04-26 17:16:00.163 WARN net.spy.memcached.protocol.binary.BinaryMemcachedNodeImpl:  Discarding partially completed op: Cmd: 0 Opaque: 28 Key: test-toolkit-1366967755495
2013-04-26 17:16:00.164 WARN net.spy.memcached.protocol.binary.BinaryMemcachedNodeImpl:  Discarding partially completed op: Cmd: 0 Opaque: 29 Key: test-toolkit-1366967755495
2013-04-26 17:16:00.164 WARN net.spy.memcached.protocol.binary.BinaryMemcachedNodeImpl:  Discarding partially completed op: Cmd: 1 Opaque: 39 Key: test-toolkit-1366967755495 Cas: 0 Exp: 5 Flags: 0 Data Length: 6
2013-04-26 17:16:00.165 INFO net.spy.memcached.MemcachedConnection:  Reconnecting due to exception on {QA sa=/10.249.194.159:11211, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=4}
java.lang.NullPointerException
	at net.spy.memcached.protocol.TCPMemcachedNodeImpl.fillWriteBuffer(TCPMemcachedNodeImpl.java:199)
	at net.spy.memcached.MemcachedConnection.handleWrites(MemcachedConnection.java:419)
	at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:383)
	at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:242)
	at net.spy.memcached.MemcachedConnection.run(MemcachedConnection.java:836)
2013-04-26 17:16:00.166 WARN net.spy.memcached.MemcachedConnection:  Closing, and reopening {QA sa=/10.249.194.159:11211, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=4}, attempt 0.
2013-04-26 17:16:00.168 WARN net.spy.memcached.MemcachedConnection:  Could not redistribute to another node, retrying primary node for test-toolkit-1366967755495.
2013-04-26 17:16:01.170 WARN net.spy.memcached.protocol.binary.BinaryMemcachedNodeImpl:  Operation canceled because authentication or reconnection and authentication has taken more than one second to complete.
2013-04-26 17:16:02.168 INFO net.spy.memcached.MemcachedConnection:  Reconnecting {QA sa=/10.249.194.159:11211, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0}
2013-04-26 17:16:02.178 INFO net.spy.memcached.MemcachedConnection:  Connection state changed for sun.nio.ch.SelectionKeyImpl@5328f6ee
2013-04-26 17:16:02.307 INFO net.spy.memcached.auth.AuthThread:  Authenticated to /10.249.194.159:11211

之后单线程也会出异常

2013-04-26 17:05:06.350 INFO net.spy.memcached.MemcachedConnection:  Added {QA sa=/10.249.194.159:11211, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0} to connect queue
2013-04-26 17:05:06.358 INFO net.spy.memcached.MemcachedConnection:  Connection state changed for sun.nio.ch.SelectionKeyImpl@2678a212
2013-04-26 17:05:06.466 INFO net.spy.memcached.auth.AuthThread:  Authenticated to /10.249.194.159:11211
Exception in thread "main" net.spy.memcached.OperationTimeoutException: Timeout waiting for value
  at net.spy.memcached.MemcachedClient.get(MemcachedClient.java:1009)
	at net.spy.memcached.MemcachedClient.get(MemcachedClient.java:1024)
	at com.aliyun.ocs.toolkit.Spy1Main.main(Spy1Main.java:22)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: net.spy.memcached.internal.CheckedOperationTimeoutException: Timed out waiting for operation - failing node: /10.249.194.159:11211
	at net.spy.memcached.internal.OperationFuture.get(OperationFuture.java:159)
	at net.spy.memcached.internal.GetFuture.get(GetFuture.java:62)
	at net.spy.memcached.MemcachedClient.get(MemcachedClient.java:1003)
	... 7 more
@inter12
Copy link

inter12 commented Jul 28, 2016

有解决方案吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment