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

Deadlock between the failover mutex (in AMQConnection.java) and the current_exception_lock (in AMQSession.java)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 0.10
    • 0.11
    • JMS AMQP 0-x
    • None

    Description

      As per the following thread dump you can clearly see the deadlock between the failover mutex in AMQConnection.java and the current_exception_lock in AMQSession.java
      This is a regression and was introduced in rev 985262

      Found one Java-level deadlock:
      =============================
      "IoReceiver - localhost/127.0.0.1:15672":
      waiting to lock monitor 0x0000002ac2ea3b70 (object 0x0000002ab70156b0, a java.lang.Object),
      which is held by "main"
      "main":
      waiting to lock monitor 0x0000002ac28db1b8 (object 0x0000002ab7048d70, a java.lang.Object),
      which is held by "IoReceiver - localhost/127.0.0.1:15672"

      Java stack information for the threads listed above:
      ===================================================
      "IoReceiver - localhost/127.0.0.1:15672":
      at org.apache.qpid.client.AMQConnection.exceptionReceived(AMQConnection.java:1297)

      • waiting to lock<0x0000002ab70156b0> (a java.lang.Object)
        at org.apache.qpid.client.AMQSession_0_10.setCurrentException(AMQSession_0_10.java:1033)
      • locked<0x0000002ab7048d70> (a java.lang.Object)
        at org.apache.qpid.client.AMQSession_0_10.exception(AMQSession_0_10.java:913)
        at org.apache.qpid.transport.SessionDelegate.executionException(SessionDelegate.java:156)
        at org.apache.qpid.transport.SessionDelegate.executionException(SessionDelegate.java:32)
        at org.apache.qpid.transport.ExecutionException.dispatch(ExecutionException.java:112)
        at org.apache.qpid.transport.SessionDelegate.command(SessionDelegate.java:50)
        at org.apache.qpid.transport.SessionDelegate.command(SessionDelegate.java:32)
        at org.apache.qpid.transport.Method.delegate(Method.java:159)
        at org.apache.qpid.transport.Session.received(Session.java:528)
        at org.apache.qpid.transport.Connection.dispatch(Connection.java:404)
        at org.apache.qpid.transport.ConnectionDelegate.handle(ConnectionDelegate.java:64)
        at org.apache.qpid.transport.ConnectionDelegate.handle(ConnectionDelegate.java:40)
        at org.apache.qpid.transport.MethodDelegate.executionException(MethodDelegate.java:110)
        at org.apache.qpid.transport.ExecutionException.dispatch(ExecutionException.java:112)
        at org.apache.qpid.transport.ConnectionDelegate.command(ConnectionDelegate.java:54)
        at org.apache.qpid.transport.ConnectionDelegate.command(ConnectionDelegate.java:40)
        at org.apache.qpid.transport.Method.delegate(Method.java:159)
        at org.apache.qpid.transport.Connection.received(Connection.java:369)
        at org.apache.qpid.transport.Connection.received(Connection.java:59)
        at org.apache.qpid.transport.network.Assembler.emit(Assembler.java:95)
        at org.apache.qpid.transport.network.Assembler.assemble(Assembler.java:196)
        at org.apache.qpid.transport.network.Assembler.frame(Assembler.java:129)
        at org.apache.qpid.transport.network.Frame.delegate(Frame.java:133)
        at org.apache.qpid.transport.network.Assembler.received(Assembler.java:100)
        at org.apache.qpid.transport.network.Assembler.received(Assembler.java:42)
        at org.apache.qpid.transport.network.InputHandler.next(InputHandler.java:187)
        at org.apache.qpid.transport.network.InputHandler.received(InputHandler.java:103)
        at org.apache.qpid.transport.network.InputHandler.received(InputHandler.java:42)
        at org.apache.qpid.transport.network.io.IoReceiver.run(IoReceiver.java:128)
        at java.lang.Thread.run(Thread.java:619)
        "main":
        at org.apache.qpid.client.AMQSession_0_10.setCurrentException(AMQSession_0_10.java:1025)
      • waiting to lock<0x0000002ab7048d70> (a java.lang.Object)
        at org.apache.qpid.client.BasicMessageConsumer_0_10.sendCancel(BasicMessageConsumer_0_10.java:193)
        at org.apache.qpid.client.BasicMessageConsumer.close(BasicMessageConsumer.java:573)
      • locked<0x0000002ab70156b0> (a java.lang.Object)
        at org.apache.qpid.client.BasicMessageConsumer.close(BasicMessageConsumer.java:535)
        at org.apache.qpid.client.AMQQueueBrowser.close(AMQQueueBrowser.java:102)
        at org.apache.qpid.test.client.QueueBrowserAutoAckTest.testFailoverWithQueueBrowser(QueueBrowserAutoAckTest.java:501)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at junit.framework.TestCase.runTest(TestCase.java:154)
        at junit.framework.TestCase.runBare(TestCase.java:127)
        at org.apache.qpid.test.utils.QpidBrokerTestCase.runBare(QpidBrokerTestCase.java:234)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:118)
        at org.apache.qpid.test.utils.QpidTestCase.run(QpidTestCase.java:120)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:297)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:672)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:546)

      Found 1 deadlock

      Attachments

        1. QPID-3214.patch
          0.7 kB
          Gordon Sim

        Activity

          People

            rajith Rajith Muditha Attapattu
            rajith Rajith Muditha Attapattu
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: