hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg Kalnichevski (JIRA)" <j...@apache.org>
Subject [jira] Created: (HTTPCLIENT-948) IdleConnectionHandler can leave closed connections in a inconsistent state
Date Wed, 02 Jun 2010 11:15:40 GMT
IdleConnectionHandler can leave closed connections in a inconsistent state

                 Key: HTTPCLIENT-948
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-948
             Project: HttpComponents HttpClient
          Issue Type: Bug
          Components: HttpConn
    Affects Versions: 4.1 Alpha2, 4.0.1
            Reporter: Oleg Kalnichevski
             Fix For: 4.1 Alpha3

IdleConnectionHandler when shutting down 'stale' connection does not update the state of AbstractPoolEntry
thus causing an inconsistency between the state of the connection (closed) and that of the
pool entry (still assumed open). The problem is mitigated by the fact that the pooling manager
usually evicts closed connections almost immediately. There is a small window of time in the
ThreadSafeClientConnManager#closeIdleConnection method, at which a connection can be closed
by the IdleConnectionHandler and immediately leased from the pool by another thread in an
inconsistent state before the main thread gets a chance to re-acquire the pool lock and clean
out closed connections.

For 4.0.x the problem can be worked around by retaining the pool lock for the entire span
of the #closeIdleConnection. For the 4.1 branch a better solution should be devised. This
probably means a complete rewrite or deprecation of IdleConnectionHandler.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org

View raw message