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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to