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

[JMS] Deadlock when closing a consumer and calling JMS operatons inside onMessage() on AMQP 0-8/0-9/0-9-1 connection

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.22
    • Fix Version/s: 0.31
    • Component/s: JMS AMQP 0-x
    • Labels:
      None

      Description

      I have run the java systests with the JCarder agent attached. When using AMQP 0-9, JCarder detected a potential deadlock when the following are done concurrently:

      • Close a consumer from an application thread.
      • Call one of the JMS operations inside MessageListener.onMessage() that uses AMQConnectionDelegate_8_0.executeRetrySupport(..).

      Here is a sketch of the deadlock scenario:

      	Thread: Dispatcher-1-Conn-600
      		AMQSession$Dispatcher.dispatchMessage()
      			lock AMQSession.this._messageDeliveryLock
      			...
      				myMessageListener.onMessage()
      					execute failover-aware operation eg createQueue, createProducer etc
      						AMQConnectionDelegate_8_0.executeRetrySupport
      							lock AMQConnection.getFailoverMutex()
      	Thread: main
      		BasicMessageConsumer.close()
      			lock AMQSession.getFailoverMutex()
      			lock AMQSession._messageDeliveryLock
      

      Interestingly, AMQConnectionDelegate_0_10.executeRetrySupport(..) does not acquire the failover mutex (I have no idea if it should) so is not susceptible to this deadlock.

      I've attached the GraphViz .dot file that JCarder generated when it detected this problem.

      Note that this problem is similar to QPID-4574 so might be fixed by a single commit.

        Attachments

        1. jcarder_result_3.dot
          0.7 kB
          Phil Harvey

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                philharveyonline Phil Harvey
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: