You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Robert Greig (JIRA)" <qp...@incubator.apache.org> on 2007/01/15 15:11:27 UTC

[jira] Resolved: (QPID-294) Race condition in establishing client connection

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

Robert Greig resolved QPID-294.
-------------------------------

       Resolution: Fixed
    Fix Version/s: M2

Patch applied svn revision 496302

> Race condition in establishing client connection 
> -------------------------------------------------
>
>                 Key: QPID-294
>                 URL: https://issues.apache.org/jira/browse/QPID-294
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Client
>            Reporter: Rob Godfrey
>             Fix For: M2
>
>         Attachments: QPID-294.patch
>
>
> Recent changes have created a race condition when establishing a client connection.
> In AMQConnection we do:
>     private void makeBrokerConnection(BrokerDetails brokerDetail) throws IOException, AMQException
>     {
>         try
>         {
>             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();
>             //Again this should be changed to a suitable notify
>             _connected = true;
>         }
> Where the AMQProtocolHandler.attainState( ) method looks like
>     public void attainState(AMQState s) throws AMQException
>     {
>         _protocolSession.getStateManager().attainState(s);
>     }
> However, _protocolSession may not yet have been set, as it is only created when the MINA thread calls AMQProtocolHandler.sessionCreated( ... )
> To fix this issue, we must create the StateManager in ProtocolHandler, and then pass this StateManager to the ProtocolSession
> Patch to be attached shortly

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