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 17:05:11 GMT
On Wed, 2010-05-26 at 11:01 -0400, Brooks, Kenneth S wrote:
> Attaching 2 log snippets.
> 
> First is the httpclient log with log4j.logger.org.apache.http=TRACE, F as the log4j setting.
I've included the very last line of the wire trace from the previous call.. just to give some
conetext. I think what you are looking for is right around: 2010-05-22 16:41:03,411
> 
> The second is our client logs, just to show when the call was attempted and failed with
the IllegalStateException.
> 
> FYI my idleconnectionhandler is running every 1000ms and evicting anything older than
20,000ms.
> 

Ken

I took a cursory look at the log and even though I have not yet found
the cause of the race condition, I am at least pretty sure I know why it
has gone undetected for so long.

Your idle connection checks are waaaaay too aggressive. It is really
unnecessary to run the checks so often. Once a minute should be enough,
let alone every second. If you want to make sure persistent connections
do not get stale, you can simply instruct HttpClient to not re-use
connections that have been idle longer than, say, 20,000ms but actively
evict connections from the pool only once a minute or so.

The idle connection handler in your configuration puts unnecessary load
on the connection pool and degrades performance. 

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