hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject RE: java.lang.IllegalStateException: Connection already open
Date Wed, 26 May 2010 21:40:13 GMT
On Wed, 2010-05-26 at 13:31 -0400, Brooks, Kenneth S wrote:
> Ok.. I had the same gut feeling when I put that in back in the 3.1 era.. 
> 
> 1) going to go look for that configuration (instructing HttpClient not to use connections
idle longer than 20,000ms).
> 2) change the idle to check each minute.. 
> 
> 
> Just to be safe.. 
> If I have a pool of 5 connections and tell it not to use connections idle longer than
20,000ms is there a chance I would run out of entries in the pool before they were evicted
and refreshed? Will it just ignore the pool size and open new connections if all 5 connections
are either active or idle longer than 20,000ms?
> 
> -k
> 

Ken,

No, there is not.The pooling connection manager is fairly clever about
persistent connections. When a connection being leased, the connection
manager will iterate through the list of available persistent
connections, pick up the first on,e which is still considered fresh when
available, and drop those connections that are no longer considered
re-usable. The connection manager will block the requesting thread only
if the maximum number of connection have been leased and are being used
for a request execution. The manager will throw an exception only if all
connections are being actively used and none has been released in time.
If there are idle connections in the pool, the manager is guaranteed to
return a valid connection, be it an existing connection, which is still
fresh, or a new one.

Oleg  


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


Mime
View raw message