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] [Resolved] (HTTPCLIENT-1104) Add way to check for release of connections back into pool
Date Fri, 23 Sep 2011 14:04:26 GMT

     [ https://issues.apache.org/jira/browse/HTTPCLIENT-1104?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Oleg Kalnichevski resolved HTTPCLIENT-1104.
-------------------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: 4.2 Final)
                   4.2 Alpha1

New connection pool and pooling connection manager implementations now expose
pool stats such number of leased & available connections. Stats can be obtained
either for a particular route or the entire pool. 

Oleg

> Add way to check for release of connections back into pool
> ----------------------------------------------------------
>
>                 Key: HTTPCLIENT-1104
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1104
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpClient
>            Reporter: John Karp
>            Priority: Minor
>             Fix For: 4.2 Alpha1
>
>
> As the documentation emphasizes, its important to clean up HttpEntities after use, so
they don't tie up the default very small number of connections in the pool.
> However, nothing is provided to HttpClient users with the default classes that allows
them to unit test their code to help verify that they are in fact properly releasing the connections
under all circumstances. One way this could be done is for the API to expose the number of
current leased (taken) connections in the pool, which would be connManager.pool.leasedConnections.size()
if not for the necessary fields being protected. If this statistic were published through
the API, user unit tests could check that it is zero when they finish.
> A workaround is for the user to subclass both the connection manager and ConnPoolByRoute
and add getter methods. But its kind of a clunky solution, and I think the API should be written
to encourage its users to perform this check.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


Mime
View raw message