消息驱动通道适配器死锁问题

时间:2015-02-06 15:13:31

标签: spring-integration ibm-mq spring-jms

我有这种死锁情况会使应用程序完全停止,不知道最新情况如何,如果你可以显示一些亮点。谢谢 这是消费者配置

<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"/>

receivingTaskExecutor20个帖子。 这就是我看到的一些阻塞线程 -

   "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)

1 个答案:

答案 0 :(得分:1)

这看起来像是mq客户端库中的一个错误。

receivingTaskExecutor-5持有客户端库拥有的锁,但其堆栈上没有客户端库堆栈帧。

receivingTaskExecutor-11正试图获取该锁(同时持有DMLC锁;其他线程正在等待它。)

因此receivingTaskExecutor-5上的客户端库中发生了某些事情,导致锁定锁定。

我建议您联系IBM支持。