Keith Wall created QPID-5796:
--------------------------------

             Summary: ConnectionRegistry may suffer an ArrayIndexOutOfBounds if 
closed at the same moment as a messaging connection is closed
                 Key: QPID-5796
                 URL: https://issues.apache.org/jira/browse/QPID-5796
             Project: Qpid
          Issue Type: Bug
          Components: Java Broker
    Affects Versions: 0.29
            Reporter: Keith Wall


If the closure of the ConnectionRegistry races with a incoming connection 
close, there is the possibility of the a AIOOBException within the 
close(replyText) method.

This issue is longstanding, but could previously only manifest on Broker 
shutdown.  With recent work on 0.29, it is now possible for the user to stop 
the virtual host (or virtualhostnode) at runtime, meaning this problem could 
manifest at non-shutdown situations too.

{code:java}
public void close(final String replyText)
    {
        synchronized(this)
        {
            for(AMQConnectionModel conn : _registry)
            {
                conn.stop();
            }
        }

        if (_logger.isDebugEnabled())
        {
            _logger.debug("Closing connection registry :" + _registry.size() + 
" connections.");
        }
        while (!_registry.isEmpty())
        {
             # <----  another thread closes a connection
            AMQConnectionModel connection = _registry.get(0);  # !#% AIOOB
            closeConnection(connection, AMQConstant.CONNECTION_FORCED, 
replyText);
        }
    }
{code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to