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

Rob Godfrey updated QPID-313:
-----------------------------

    Attachment: QPID-313.patch

> [Race Condition] Call to attainState in makeBrokerConnection can miss the 
> notification of state change.
> -------------------------------------------------------------------------------------------------------
>
>                 Key: QPID-313
>                 URL: https://issues.apache.org/jira/browse/QPID-313
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Client
>            Reporter: Martin Ritchie
>            Priority: Blocker
>         Attachments: QPID-313.patch
>
>
> in AMQConnection()
>             
> TransportConnection.getInstance(brokerDetail).connect(_protocolHandler, 
> brokerDetail);
>             // this blocks until the connection has been set up or when an 
> error
>             // has prevented the connection being set up
>             _protocolHandler.attainState(AMQState.CONNECTION_OPEN);
>             _failoverPolicy.attainedConnection();
> This is the only use of attainState in the code. Problem is that the connect 
> can occur and proceed without locking on the state to attain.
> Possible issue in AMQStateManager... attainState() [again only call to this 
> is the above code]
> The _currentState is checked inside synchronized (_stateListener) block. 
> However _currentState is modifed in the changeState method OUTSIDE of the 
> synchronized (_stateListener)  block. Doing the change in side the block 
> should ensure that the attainState waiter is setup correctly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to