hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: ConnectionShutdownException and connection leak
Date Tue, 05 Jul 2016 15:02:04 GMT
On Mon, 2016-07-04 at 15:45 +0000, S├ębastien HEUZE wrote:
> Hi,
> We are encountering a little problem with our production server that use
> RestTemplate, DefaultHttpClient,
> HttpComponentsClientHttpRequestFactory, ThreadSafeClientConnManager and SSL
> connection.
> The server send (same route) approx 300k requests a day (1s timeout),
> everything is fine except that we have connexion leak.
> We tried setting a keepalive, setting a eviction thread, setting Pool ttl
> but none of these worked.
> And later we found the problem, each time the ConnectionShutdownException
> is thrown, we have a connection  leak.
> So in a week, our connection pool is filled and we need a server restart.
> We have tested with a limited number of threads (50 during a limited time)
> so we know how many open connection we have.
> First it start with 50 connections, and each time we have an Exception we
> have 1 connection leak.
> So I tried to find a solution and I got one
> Calling abortConnection in ConnectionShutdownException catch in
> DefaultRequestDIrector class
> It don't solve the unexpected ConnectionShutdown but it avoid connection
> leak..
> Do you have a better Idea to fix the solution ? (we can't upgrade our
> HttpClient to 4.3 since it will require to upgrade spring version)

Please consider upgrading to HttpClient 4.5. All GA releases of
HttpClient are backward compatible.


> Thanks
> Spring Framework 3.1.4.RELEASE
> Httpclient 4.1.4  (Tried dwith 4.1.1 (original) and 4.1.4)
> Seems to be almost the same than this one :
> http://mail-archives.apache.org/mod_mbox/hc-httpclient-users/201203.mbox/%3C1332962280.2716.7.camel@ubuntu%3E

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

View raw message