Uploaded image for project: 'Qpid'
  1. Qpid
  2. QPID-4574

[JMS] Deadlock involving _failoverMutex and _messageDeliveryLock

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.14, 0.16, 0.18, 0.20
    • Fix Version/s: 0.31
    • Component/s: JMS AMQP 0-x
    • Labels:

      Description

      This deadlock can manifest when a you have a producer sending messages inside an onMessage() call, while another thread is either closing the session or the consumer.

      Sending a message inside onMessage() is a common enough pattern, and is used by intermediaries like Message Bridges, ESB's etc..

      Here is an example stack trace, showing deadlock occuring when closing the consumer:

      "Dispatcher-0-Conn-1":
      	at org.apache.qpid.client.BasicMessageProducer.send(BasicMessageProducer.java:309)
      	- waiting to lock <0x00000000ecfd15a8> (a java.lang.Object)
      	at Test_00782235$1.onMessage(Test_00782235.java:29)
      	at org.apache.qpid.client.BasicMessageConsumer.notifyMessage(BasicMessageConsumer.java:751)
      	at org.apache.qpid.client.BasicMessageConsumer_0_10.notifyMessage(BasicMessageConsumer_0_10.java:141)
      	at org.apache.qpid.client.BasicMessageConsumer.notifyMessage(BasicMessageConsumer.java:725)
      	at org.apache.qpid.client.BasicMessageConsumer_0_10.notifyMessage(BasicMessageConsumer_0_10.java:186)
      	at org.apache.qpid.client.BasicMessageConsumer_0_10.notifyMessage(BasicMessageConsumer_0_10.java:54)
      	at org.apache.qpid.client.AMQSession$Dispatcher.notifyConsumer(AMQSession.java:3479)
      	at org.apache.qpid.client.AMQSession$Dispatcher.dispatchMessage(AMQSession.java:3418)
      	- locked <0x00000000ecfd16c8> (a java.lang.Object)
      	- locked <0x00000000ecfd16d8> (a java.lang.Object)
      	at org.apache.qpid.client.AMQSession$Dispatcher.access$1000(AMQSession.java:3205)
      	at org.apache.qpid.client.AMQSession.dispatch(AMQSession.java:3198)
      	at org.apache.qpid.client.message.UnprocessedMessage.dispatch(UnprocessedMessage.java:54)
      	at org.apache.qpid.client.AMQSession$Dispatcher.run(AMQSession.java:3341)
      	at java.lang.Thread.run(Thread.java:679)
      
      "main":
      	at org.apache.qpid.client.BasicMessageConsumer.close(BasicMessageConsumer.java:598)
      	- waiting to lock <0x00000000ecfd16c8> (a java.lang.Object)
      	- locked <0x00000000ecfd15a8> (a java.lang.Object)
      	at org.apache.qpid.client.BasicMessageConsumer.close(BasicMessageConsumer.java:558)
      	at Test_00782235.<init>(Test_00782235.java:62)
      	at Test_00782235.main(Test_00782235.java:12)
      

        Attachments

        1. Test_00782235.java
          2 kB
          Rajith Muditha Attapattu

          Issue Links

            Activity

              People

              • Assignee:
                rajith Rajith Muditha Attapattu
                Reporter:
                rajith Rajith Muditha Attapattu
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: