[ 
https://issues.apache.org/jira/browse/QPID-4086?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Robbie Gemmell updated QPID-4086:
---------------------------------

    Assignee:     (was: Robbie Gemmell)
      Status: Open  (was: Ready To Review)

Looking over the patch several times and almost being ready to apply it, I have 
come to think it resolves this specific case but potentially creates various 
other similar issues. Reversing the locks in the close() method would fix this 
instance, but because the Dispatcher thread acquires the message delivery lock 
and then application code is able to use that thread to perform work in 
onMessage, it would then be possible for the work undertaken to acquire the 
other lock in a variety of locations and end up creating new issues.

Given this is a long standing issue, the proximity to the next release, and the 
fact this particular scenario (failover attempts being exhausted at the exact 
same time an application-initiated connection close occurs) isn't that likely 
in typical use I think we need to defer making immediate changes to this area 
and look at a longer term solution.

I have updated the specific tests that inadvertently hit the issue (via 
QPID-4080) sporadically to stop them doing so, and we can add a more targeted 
test when any work is done on this JIRA.
                
> Java Client 0-9.x deadlocks on concurrent connection close and session close 
> from failover thread
> -------------------------------------------------------------------------------------------------
>
>                 Key: QPID-4086
>                 URL: https://issues.apache.org/jira/browse/QPID-4086
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Client
>    Affects Versions: 0.16, 0.17
>            Reporter: Alex Rudyy
>         Attachments: 0001-QPID-4086-Fix-deadlock.patch, deadlock.txt
>
>
> Java Client 0-8/0-9.x deadlocks on concurrent connection close and session 
> close from failover thread
> {noformat}
> Java stack information for the threads listed above:
> ===================================================
> "Failover":
>       at org.apache.qpid.client.AMQSession.closed(AMQSession.java:822)
>       - waiting to lock <0x00000000e03c3160> (a java.lang.Object)
>       at 
> org.apache.qpid.client.AMQConnection.closeAllSessions(AMQConnection.java:954)
>       at 
> org.apache.qpid.client.AMQConnection.exceptionReceived(AMQConnection.java:1298)
>       - locked <0x00000000e03c71b8> (a java.lang.Object)
>       at 
> org.apache.qpid.client.failover.FailoverHandler.run(FailoverHandler.java:187)
>       - locked <0x00000000e03c71b8> (a java.lang.Object)
>       at java.lang.Thread.run(Thread.java:662)
> "main":
>       at org.apache.qpid.client.AMQConnection.doClose(AMQConnection.java:857)
>       - waiting to lock <0x00000000e03c71b8> (a java.lang.Object)
>       - locked <0x00000000e03c71c8> (a java.lang.Object)
>       at org.apache.qpid.client.AMQConnection.doClose(AMQConnection.java:848)
>       - locked <0x00000000e03c3160> (a java.lang.Object)
>       - locked <0x00000000e03c71c8> (a java.lang.Object)
>       at org.apache.qpid.client.AMQConnection.close(AMQConnection.java:832)
>       at org.apache.qpid.client.AMQConnection.close(AMQConnection.java:823)
>       at org.apache.qpid.client.AMQConnection.close(AMQConnection.java:818)
>       at 
> org.apache.qpid.test.utils.QpidBrokerTestCase.tearDown(QpidBrokerTestCase.java:1177)
>       at junit.framework.TestCase.runBare(TestCase.java:130)
>       at 
> org.apache.qpid.test.utils.QpidBrokerTestCase.runBare(QpidBrokerTestCase.java:239)
>       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:137)
>       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:520)
>       at 
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:1060)
>       at 
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:911)
> Found 1 deadlock.
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to