bluegitter / xmemcached

Automatically exported from code.google.com/p/xmemcached
0 stars 0 forks source link

高负载下死锁 #285

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. 读写负载比较高时
2. 节点失效
3. 尝试关闭整个client

What is the expected output? What do you see instead?

出现死锁(当时有10几个节点同时出现,负载低的节点没有出
现)。由于死锁的出现,导致jvm 
shutdown无法完成以及尝试关闭关闭client的线程无法释放。

What version of the product are you using? On what operating system?

2.6.32-279.14.1.el6.x86_64,jdk1.7u51,jdk1.8ga

Please provide any additional information below.

给出当初死锁的jstack情况:

Found one Java-level deadlock:
=============================
"xmemcached-read-thread-1-thread-14":
  waiting to lock monitor 0x00007f9750520988 (object 0x00000006b760e9e8, a net.rubyeye.xmemcached.impl.MemcachedConnector),
  which is held by "pool-3-thread-1"
"pool-3-thread-1":
  waiting to lock monitor 0x00007f96d017e898 (object 0x00000006b7bab458, a net.rubyeye.xmemcached.impl.MemcachedTCPSession),
  which is held by "Xmemcached-Reactor-8"
"Xmemcached-Reactor-8":
  waiting to lock monitor 0x00007f9750520988 (object 0x00000006b760e9e8, a net.rubyeye.xmemcached.impl.MemcachedConnector),
  which is held by "pool-3-thread-1"

Java stack information for the threads listed above:
===================================================
"xmemcached-read-thread-1-thread-14":
    at net.rubyeye.xmemcached.impl.MemcachedConnector.removeSession(MemcachedConnector.java:344)
    - waiting to lock <0x00000006b760e9e8> (a net.rubyeye.xmemcached.impl.MemcachedConnector)
    at net.rubyeye.xmemcached.impl.MemcachedHandler.onSessionClosed(MemcachedHandler.java:159)
    at com.google.code.yanf4j.core.impl.AbstractSession.onClosed(AbstractSession.java:305)
    at com.google.code.yanf4j.core.impl.AbstractSession.close(AbstractSession.java:293)
    at com.google.code.yanf4j.nio.impl.NioTCPSession.readFromBuffer(NioTCPSession.java:217)
    at com.google.code.yanf4j.nio.impl.AbstractNioSession.onRead(AbstractNioSession.java:196)
    at com.google.code.yanf4j.nio.impl.AbstractNioSession.onEvent(AbstractNioSession.java:341)
    at com.google.code.yanf4j.nio.impl.SocketChannelController.dispatchReadEvent(SocketChannelController.java:56)
    at com.google.code.yanf4j.nio.impl.NioController$ReadTask.run(NioController.java:110)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)
"pool-3-thread-1":
    at com.google.code.yanf4j.core.impl.AbstractSession.close(AbstractSession.java:280)
    - waiting to lock <0x00000006b7bab458> (a net.rubyeye.xmemcached.impl.MemcachedTCPSession)
    at com.google.code.yanf4j.core.impl.AbstractController.stop(AbstractController.java:467)
    - locked <0x00000006b760e9e8> (a net.rubyeye.xmemcached.impl.MemcachedConnector)
    at net.rubyeye.xmemcached.XMemcachedClient.shutdown(XMemcachedClient.java:2395)
 ...
    at java.lang.Thread.run(Thread.java:744)
"Xmemcached-Reactor-8":
    at com.google.code.yanf4j.core.impl.AbstractController.unregisterSession(AbstractController.java:438)
    - waiting to lock <0x00000006b760e9e8> (a net.rubyeye.xmemcached.impl.MemcachedConnector)
    at com.google.code.yanf4j.nio.impl.Reactor.dispatchSessionEvent(Reactor.java:433)
    at com.google.code.yanf4j.nio.impl.Reactor.registerSession(Reactor.java:389)
    at com.google.code.yanf4j.nio.impl.SelectorManager.registerSession(SelectorManager.java:171)
    at com.google.code.yanf4j.nio.impl.AbstractNioSession.unregisterSession(AbstractNioSession.java:228)
    at com.google.code.yanf4j.nio.impl.NioTCPSession.closeChannel(NioTCPSession.java:340)
    at com.google.code.yanf4j.core.impl.AbstractSession.close(AbstractSession.java:286)
    at com.google.code.yanf4j.nio.impl.AbstractNioSession.onWrite(AbstractNioSession.java:164)
    at com.google.code.yanf4j.nio.impl.AbstractNioSession.writeFromUserCode(AbstractNioSession.java:237)
    at com.google.code.yanf4j.core.impl.AbstractSession.write(AbstractSession.java:383)
    at net.rubyeye.xmemcached.impl.MemcachedHandler.checkHeartBeat(MemcachedHandler.java:205)
    at net.rubyeye.xmemcached.impl.MemcachedHandler.onSessionIdle(MemcachedHandler.java:182)
    at com.google.code.yanf4j.core.impl.AbstractSession.onIdle(AbstractSession.java:193)
    - locked <0x00000006b7bab458> (a net.rubyeye.xmemcached.impl.MemcachedTCPSession)
    at com.google.code.yanf4j.nio.impl.AbstractNioSession.onEvent(AbstractNioSession.java:350)
    at com.google.code.yanf4j.nio.impl.Reactor.checkIdle(Reactor.java:474)
    at com.google.code.yanf4j.nio.impl.Reactor.checkExpiredIdle(Reactor.java:465)
    at com.google.code.yanf4j.nio.impl.Reactor.checkSessionTimeout(Reactor.java:365)
    at com.google.code.yanf4j.nio.impl.Reactor.run(Reactor.java:122)

Original issue reported on code.google.com by boywang...@gmail.com on 27 Mar 2014 at 2:26

GoogleCodeExporter commented 9 years ago
不好意思忘记贴xmemcached版本号了。1.4.3

Original comment by boywang...@gmail.com on 27 Mar 2014 at 2:27

GoogleCodeExporter commented 9 years ago
感谢反馈,我周末看下。

Original comment by xzhu...@avos.com on 27 Mar 2014 at 7:16

GoogleCodeExporter commented 9 years ago
v2.0.0已发布。

Original comment by killme2...@gmail.com on 28 Apr 2014 at 8:11