[
https://issues.apache.org/jira/browse/QPID-4086?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13400411#comment-13400411
]
Alex Rudyy commented on QPID-4086:
----------------------------------
Hi Keith,
You are right, it seems that existing implementation of Connection#close (even
without suggested changes) does not confirm the JMS spec requirements from
4.3.5, as we set the connection close flag into true before acquiring any
delivery lock. As result, all commit/rollback/acknowledge calls will fail from
MessageListener when Connection#close is invoked at the point when message
arrives into message listener.
The changes I suggested actually makes the issue evn worth as delivery lock
would be acquired after the Session close flag is set to true.
I will amend my patch to acquire delivery lock before session#close is invoked
but we still need to change the Connection#close functionality to fully confirm
JMS spec requirements from 4.3.5 "Closing a Connection". I will raise a
separate JIRA about breaking JMS spec 4.3.5 requirements.
> 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
> Assignee: Keith Wall
> Attachments:
> 0001-QPID-4086-Remove-redundant-synchronization-on-messag.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]