消息驱动的通道适配器死锁问题
message-driven-channel-adapter deadlock issues
我遇到了这种使应用程序完全停止的死锁情况,不确定发生了什么,如果您能显示一些信息。谢谢
这是消费者配置
<jms:message-driven-channel-adapter
id="InBoundZFlow"
connection-factory="wmqConnFactory"
destination="ResponseQueue"
channel="responseInChannel"
auto-startup="false"
max-messages-per-task="20"
receive-timeout="10000"
concurrent-consumers="2"
task-executor="receivingTaskExecutor"
max-concurrent-consumers="20"
idle-consumer-limit="1"
idle-task-execution-limit="1"
recovery-interval="60000"/>
receivingTaskExecutor
有 20
个线程。
这是我看到的一些阻塞线程 -
"receivingTaskExecutor-19" - Thread t@226
java.lang.Thread.State: BLOCKED
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.clearResources(DefaultMessageListenerContainer.java:1142)
- waiting to lock <1f7cd479> (a java.lang.Object) owned by "receivingTaskExecutor-11" t@111
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1002)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:679)
"rceivingTaskExecutor-16" - Thread t@184
java.lang.Thread.State: BLOCKED
at org.springframework.jms.listener.AbstractJmsListeningContainer.isRunning(AbstractJmsListeningContainer.java:347)
- waiting to lock <3c616415> (a java.lang.Object) owned by "receivingTaskExecutor-7" t@69
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:995)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:679)
Locked ownable synchronizers:
- locked <712a95c7> (a java.util.concurrent.ThreadPoolExecutor$Worker)
----------------------------------------------------
"mqReceivingTaskExecutor-7" - Thread t@69
java.lang.Thread.State: BLOCKED
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.clearResources(DefaultMessageListenerContainer.java:1142)
- waiting to lock <1f7cd479> (a java.lang.Object) owned by "mqReceivingTaskExecutor-11" t@111
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1043)
- locked <3c616415> (a java.lang.Object)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:679)
Locked ownable synchronizers:
- locked <a01ec0b> (a java.util.concurrent.ThreadPoolExecutor$Worker)
---------------------------------------------------------
"receivingTaskExecutor-11" - Thread t@111
java.lang.Thread.State: WAITING
at sun.misc.Unsafe.park(Native Method)
- waiting to lock <1df1bdab> (a java.util.concurrent.locks.ReentrantLock$NonfairSync) owned by "receivingTaskExecutor-5" t@65
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:838)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:871)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1201)
at java.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:214)
at java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:290)
at com.ibm.mq.jmqi.remote.impl.RemoteConnection.requestSendLock(RemoteConnection.java:2842)
at com.ibm.mq.jmqi.remote.impl.RemoteConnection.sendTSH(RemoteConnection.java:1812)
at com.ibm.mq.jmqi.remote.impl.RemoteSession.sendTSH(RemoteSession.java:758)
at com.ibm.mq.jmqi.remote.impl.RemoteSession.exchangeTSH(RemoteSession.java:1237)
at com.ibm.mq.jmqi.remote.api.RemoteFAP.spiNotify(RemoteFAP.java:4612)
at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiNotify(RemoteFAP.java:4449)
at com.ibm.mq.jmqi.monitoring.JmqiInterceptAdapter.jmqiNotify(JmqiInterceptAdapter.java:579)
at com.ibm.msg.client.wmq.internal.WMQSyncConsumerShadow.setRunning(WMQSyncConsumerShadow.java:462)
at com.ibm.msg.client.wmq.internal.WMQMessageConsumer.stop(WMQMessageConsumer.java:535)
at com.ibm.msg.client.jms.internal.JmsMessageConsumerImpl.stopUnconditional(JmsMessageConsumerImpl.java:706)
at com.ibm.msg.client.jms.internal.JmsSessionImpl.stop(JmsSessionImpl.java:2014)
- locked <2a02832d> (a java.util.Collections$SynchronizedSet)
- locked <af214e7> (a java.lang.Object)
at com.ibm.msg.client.jms.internal.JmsSessionImpl.close(JmsSessionImpl.java:315)
at com.ibm.msg.client.jms.internal.JmsConnectionImpl.close(JmsConnectionImpl.java:300)
- locked <1b3a4f4e> (a com.ibm.msg.client.jms.internal.State)
at com.ibm.mq.jms.MQConnection.close(MQConnection.java:98)
at org.springframework.jms.connection.ConnectionFactoryUtils.releaseConnection(ConnectionFactoryUtils.java:80)
at org.springframework.jms.listener.AbstractJmsListeningContainer.refreshSharedConnection(AbstractJmsListeningContainer.java:395)
- locked <1f7cd479> (a java.lang.Object)
at org.springframework.jms.listener.DefaultMessageListenerContainer.refreshConnectionUntilSuccessful(DefaultMessageListenerContainer.java:885)
at org.springframework.jms.listener.DefaultMessageListenerContainer.recoverAfterListenerSetupFailure(DefaultMessageListenerContainer.java:861)
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1013)
- locked <112c97d9> (a java.lang.Object)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:679)
Locked ownable synchronizers:
- locked <33d65cd0> (a java.util.concurrent.ThreadPoolExecutor$Worker)
- locked <6a5305e> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)
"receivingTaskExecutor-5" - Thread t@65
java.lang.Thread.State: BLOCKED
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.clearResources(DefaultMessageListenerContainer.java:1142)
- waiting to lock <1f7cd479> (a java.lang.Object) owned by "receivingTaskExecutor-11" t@111
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1002)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:679)
Locked ownable synchronizers:
- locked <19f71b53> (a java.util.concurrent.ThreadPoolExecutor$Worker)
- locked <1df1bdab> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)
这看起来像是 mq 客户端库中的错误。
receivingTaskExecutor-5
持有客户端库拥有的锁,但其堆栈上没有客户端库堆栈帧。
receivingTaskExecutor-11
正在尝试获取该锁(同时持有 DMLC
锁;其他线程正在等待)。
所以客户端库在 receivingTaskExecutor-5
发生了一些事情,导致它保持锁定状态。
我建议您联系 IBM 支持。
我遇到了这种使应用程序完全停止的死锁情况,不确定发生了什么,如果您能显示一些信息。谢谢 这是消费者配置
<jms:message-driven-channel-adapter
id="InBoundZFlow"
connection-factory="wmqConnFactory"
destination="ResponseQueue"
channel="responseInChannel"
auto-startup="false"
max-messages-per-task="20"
receive-timeout="10000"
concurrent-consumers="2"
task-executor="receivingTaskExecutor"
max-concurrent-consumers="20"
idle-consumer-limit="1"
idle-task-execution-limit="1"
recovery-interval="60000"/>
receivingTaskExecutor
有 20
个线程。
这是我看到的一些阻塞线程 -
"receivingTaskExecutor-19" - Thread t@226
java.lang.Thread.State: BLOCKED
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.clearResources(DefaultMessageListenerContainer.java:1142)
- waiting to lock <1f7cd479> (a java.lang.Object) owned by "receivingTaskExecutor-11" t@111
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1002)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:679)
"rceivingTaskExecutor-16" - Thread t@184
java.lang.Thread.State: BLOCKED
at org.springframework.jms.listener.AbstractJmsListeningContainer.isRunning(AbstractJmsListeningContainer.java:347)
- waiting to lock <3c616415> (a java.lang.Object) owned by "receivingTaskExecutor-7" t@69
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:995)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:679)
Locked ownable synchronizers:
- locked <712a95c7> (a java.util.concurrent.ThreadPoolExecutor$Worker)
----------------------------------------------------
"mqReceivingTaskExecutor-7" - Thread t@69
java.lang.Thread.State: BLOCKED
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.clearResources(DefaultMessageListenerContainer.java:1142)
- waiting to lock <1f7cd479> (a java.lang.Object) owned by "mqReceivingTaskExecutor-11" t@111
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1043)
- locked <3c616415> (a java.lang.Object)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:679)
Locked ownable synchronizers:
- locked <a01ec0b> (a java.util.concurrent.ThreadPoolExecutor$Worker)
---------------------------------------------------------
"receivingTaskExecutor-11" - Thread t@111
java.lang.Thread.State: WAITING
at sun.misc.Unsafe.park(Native Method)
- waiting to lock <1df1bdab> (a java.util.concurrent.locks.ReentrantLock$NonfairSync) owned by "receivingTaskExecutor-5" t@65
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:838)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:871)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1201)
at java.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:214)
at java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:290)
at com.ibm.mq.jmqi.remote.impl.RemoteConnection.requestSendLock(RemoteConnection.java:2842)
at com.ibm.mq.jmqi.remote.impl.RemoteConnection.sendTSH(RemoteConnection.java:1812)
at com.ibm.mq.jmqi.remote.impl.RemoteSession.sendTSH(RemoteSession.java:758)
at com.ibm.mq.jmqi.remote.impl.RemoteSession.exchangeTSH(RemoteSession.java:1237)
at com.ibm.mq.jmqi.remote.api.RemoteFAP.spiNotify(RemoteFAP.java:4612)
at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiNotify(RemoteFAP.java:4449)
at com.ibm.mq.jmqi.monitoring.JmqiInterceptAdapter.jmqiNotify(JmqiInterceptAdapter.java:579)
at com.ibm.msg.client.wmq.internal.WMQSyncConsumerShadow.setRunning(WMQSyncConsumerShadow.java:462)
at com.ibm.msg.client.wmq.internal.WMQMessageConsumer.stop(WMQMessageConsumer.java:535)
at com.ibm.msg.client.jms.internal.JmsMessageConsumerImpl.stopUnconditional(JmsMessageConsumerImpl.java:706)
at com.ibm.msg.client.jms.internal.JmsSessionImpl.stop(JmsSessionImpl.java:2014)
- locked <2a02832d> (a java.util.Collections$SynchronizedSet)
- locked <af214e7> (a java.lang.Object)
at com.ibm.msg.client.jms.internal.JmsSessionImpl.close(JmsSessionImpl.java:315)
at com.ibm.msg.client.jms.internal.JmsConnectionImpl.close(JmsConnectionImpl.java:300)
- locked <1b3a4f4e> (a com.ibm.msg.client.jms.internal.State)
at com.ibm.mq.jms.MQConnection.close(MQConnection.java:98)
at org.springframework.jms.connection.ConnectionFactoryUtils.releaseConnection(ConnectionFactoryUtils.java:80)
at org.springframework.jms.listener.AbstractJmsListeningContainer.refreshSharedConnection(AbstractJmsListeningContainer.java:395)
- locked <1f7cd479> (a java.lang.Object)
at org.springframework.jms.listener.DefaultMessageListenerContainer.refreshConnectionUntilSuccessful(DefaultMessageListenerContainer.java:885)
at org.springframework.jms.listener.DefaultMessageListenerContainer.recoverAfterListenerSetupFailure(DefaultMessageListenerContainer.java:861)
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1013)
- locked <112c97d9> (a java.lang.Object)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:679)
Locked ownable synchronizers:
- locked <33d65cd0> (a java.util.concurrent.ThreadPoolExecutor$Worker)
- locked <6a5305e> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)
"receivingTaskExecutor-5" - Thread t@65
java.lang.Thread.State: BLOCKED
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.clearResources(DefaultMessageListenerContainer.java:1142)
- waiting to lock <1f7cd479> (a java.lang.Object) owned by "receivingTaskExecutor-11" t@111
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1002)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:679)
Locked ownable synchronizers:
- locked <19f71b53> (a java.util.concurrent.ThreadPoolExecutor$Worker)
- locked <1df1bdab> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)
这看起来像是 mq 客户端库中的错误。
receivingTaskExecutor-5
持有客户端库拥有的锁,但其堆栈上没有客户端库堆栈帧。
receivingTaskExecutor-11
正在尝试获取该锁(同时持有 DMLC
锁;其他线程正在等待)。
所以客户端库在 receivingTaskExecutor-5
发生了一些事情,导致它保持锁定状态。
我建议您联系 IBM 支持。