activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrei N.Sobchuck (JIRA)" <>
Subject [jira] [Created] (AMQ-4441) Race condition in PooledConnectionFactory.createConnection
Date Fri, 05 Apr 2013 07:16:15 GMT
Andrei N.Sobchuck created AMQ-4441:

             Summary: Race condition in PooledConnectionFactory.createConnection
                 Key: AMQ-4441
             Project: ActiveMQ
          Issue Type: Bug
          Components: activemq-pool
    Affects Versions: 5.8.0
            Reporter: Andrei N.Sobchuck

`PooledConnectionFactory.createConnection(String userName, String password)` can return broken
Connection. By `broken` I mean PooledConnection with referenceCount==1, but without underlying
The problem is in lines 
connection = connectionsPool.borrowObject(key);
return new PooledConnection(connection);
While method `borrowObject` validates the connection and `new PooledConnection` increments
referenceCount, it's possible that some thread calls `ConnectionPool.decrementReferenceCount()`
just between `borrowObject` and `new PooledConnection`. referenceCount at this stage can be
a zero and the ConnectionPool became closed just prior to `new PooledConnection`.

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:

View raw message