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

Kevin Earls commented on AMQ-4375:
----------------------------------

I don't think we can resolve this as long as we are using the QPID client, 
because starting a connection in QPID is not fully synchronous. 
connection.start() creates a org.apache.qpid.amqp_1_0.jms.impl.ConnectionImpl, 
which in turn creates a creates a org.apache.qpid.amqp_1_0.client.Connection. 
This Connection creates a ConnectionEndpoint in its constructor and then calls 
open() on that.

ConnectionEndpoint.open() sends the open packet to the server. However, it 
doesn't wait for a response. It sets _state = ConnectionState.AWAITING_OPEN and 
returns. (The response from the server ends up getting handled by the thread 
named inputThread that Connection also creates in its constructor).

This can create a short race condition, which doesn't matter most places. I 
think it's a problem here because it takes longer for the server to create a 
connection when using SSL, and the test cases in UnifiedSessionTests aren't 
really doing very much. For example, for 
testCreateDurableConnectionConsumerOnQueueConnection it creates a 
QueueConnection in setUp(), calls 
QueueConnection.createDurableConnectionConsumer() which immediately throws an 
IllegalStateException, and then hangs trying to close the QueueConnection in 
tearDown(). As far as I can tell the test ends up calling close() on the 
connection before it's finished opening, and the result is a deadlock.

All of the tests pass if I add a short sleep to the setup to allow the 
connections to finish opening, but I don't think we can do that with the 
JoramJmsTests.

                
> JoramJmsTest UnifiedSessionTest hangs on Windows or when run with AMQP+SSL
> --------------------------------------------------------------------------
>
>                 Key: AMQ-4375
>                 URL: https://issues.apache.org/jira/browse/AMQ-4375
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Test Cases
>         Environment: Windows 7 and Windows 2008 Server
>            Reporter: Kevin Earls
>         Attachments: UnifiedSessionTestWithSSL.txt
>
>
> This test suite results in a hang when run on windows.  I'll attach a patch 
> which excludes it on Windows for now.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to