You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Rob Godfrey (JIRA)" <qp...@incubator.apache.org> on 2007/02/15 17:20:06 UTC

[jira] Assigned: (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 ]

Rob Godfrey reassigned QPID-294:
--------------------------------

    Assignee: Rob Godfrey

> 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
>         Assigned To: 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.
-
You can reply to this email to add a comment to the issue online.