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/01/15 13:35:27 UTC
[jira] Created: (QPID-294) Race condition in establishing client
connection
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
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
[jira] Updated: (QPID-294) Race condition in establishing client
connection
Posted by "Rob Godfrey (JIRA)" <qp...@incubator.apache.org>.
[ https://issues.apache.org/jira/browse/QPID-294?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Rob Godfrey updated QPID-294:
-----------------------------
Attachment: QPID-294.patch
> 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
> 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
[jira] Resolved: (QPID-294) Race condition in establishing client
connection
Posted by "Robert Greig (JIRA)" <qp...@incubator.apache.org>.
[ 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
[jira] Assigned: (QPID-294) Race condition in establishing client
connection
Posted by "Rob Godfrey (JIRA)" <qp...@incubator.apache.org>.
[ 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.