hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fang Lin <Fang...@u.washington.edu>
Subject RE: ConnectionPoolTimeoutException
Date Fri, 22 Jul 2011 18:38:36 GMT
That's exactly the case in my situation. Thank you both!!
-----Original Message-----
From: Sam Crawford [mailto:samcrawford@gmail.com] 
Sent: Friday, July 22, 2011 5:55 AM
To: HttpClient User Discussion
Subject: Re: ConnectionPoolTimeoutException

My experience leads me to agree with Oleg. I would suggest adding logging for connection management
(see http://hc.apache.org/httpcomponents-client-ga/logging.html).

Make sure you're always consuming the content when handling responses.
When I first began working with HttpClient I was aborting our response handling process if
I saw a non-2xx/3xx response code *without* consuming the response - this led to the connection
not being evicted.

Thanks,

Sam


On 22 July 2011 13:26, Oleg Kalnichevski <olegk@apache.org> wrote:
> On Thu, 2011-07-21 at 18:47 +0000, Fang Lin wrote:
>> Often getting org.apache.http.conn.ConnectionPoolTimeoutException: 
>> Timeout waiting for connection
>>         at 
>> org.apache.http.impl.conn.tsccm.ConnPoolByRoute.getEntryBlocking(Conn
>> PoolByRoute.java:417)
>>         at 
>> org.apache.http.impl.conn.tsccm.ConnPoolByRoute$1.getPoolEntry(ConnPo
>> olByRoute.java:300)
>>         at 
>> org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager$1.getConn
>> ection(ThreadSafeClientConnManager.java:224)
>>         at 
>> org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultReq
>> uestDirector.java:391)
>>         at 
>> org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpCl
>> ient.java:820) when there were only two active connections in a 
>> ConnPoolByRoute whose  max connection is set to 10.
>> This case happened with some routes but not all routes. Once it started, only restarting
tomcat would fix the issue.
>> Any suggestion?
>>
>>
>> Httpclient 4.1.1, httpcore 4.1.2
>>
>> Java(TM) SE Runtime Environment (build 1.6.0_23-b05) Java HotSpot(TM) 
>> 64-Bit Server VM (build 19.0-b09, mixed mode)
>>
>
> I suspect your code is leaking connections.
>
> Oleg
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>

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


---------------------------------------------------------------------
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