[ 
https://issues.apache.org/jira/browse/QPID-3512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13116499#comment-13116499
 ] 

Keith Wall commented on QPID-3512:
----------------------------------

This is a race condition on the client side occurring during connection close. 
We have two threads racing to close the connection.

When the test passes, the IoReceiver (processing the ConnectionClose) thread on 
the client side that completely closes the connection before the test thread 
calls AMQConnection#close(). The test thread finds the AMQConnection#_closed 
atomic already set true so the #close call returns and the test passes.

When the test fails, the actions of IoReceiver thread and the test thread race 
to close the connection.  The IoReceiver thread records the cause for the 
connection close (AMQConnectionClosedException: Error: Broker is shutting down 
[error code 320: connection forced]), meanwhile the test thread tries to close 
the connection too.  In AMQProtocolHandler#writeCommandFrameAndWaitForReply it 
finds that the state manager already has a saved exception 
(AMQConnectionClosedException) so it throws it and the test fails.

                
> ConnectionCloseTest occasionally fails on java-mms.0-9-1 profile
> ----------------------------------------------------------------
>
>                 Key: QPID-3512
>                 URL: https://issues.apache.org/jira/browse/QPID-3512
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Client
>    Affects Versions: 0.13
>            Reporter: Keith Wall
>            Assignee: Keith Wall
>
> The new test ConnectionCloseTest#testConnectionCloseOnOnForcibleBrokerStop 
> added for QPID-3453 is occasionally seen to fail on an old slow CI box.
> {code}
> org.apache.qpid.test.unit.client.connection.ConnectionCloseTest (1)
> TestName: testConnectionCloseOnOnForcibleBrokerStop Duration: 0.229
> Cannot close connection:Error closing connection: 
> org.apache.qpid.AMQConnectionClosedException: Error: Broker is shutting down 
> [error code 320: connection forced]
> junit.framework.AssertionFailedError: Cannot close connection:Error closing 
> connection: org.apache.qpid.AMQConnectionClosedException: Error: Broker is 
> shutting down [error code 320: connection forced]
> at 
> org.apache.qpid.test.unit.client.connection.ConnectionCloseTest.testConnectionCloseOnOnForcibleBrokerStop(ConnectionCloseTest.java:123)
> at 
> org.apache.qpid.test.utils.QpidBrokerTestCase.runBare(QpidBrokerTestCase.java:238)
> at org.apache.qpid.test.utils.QpidTestCase.run(QpidTestCase.java:131)
> {code}

--
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

        

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to