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: [4.3.3] Newbie question about Stale Check
Date Mon, 14 Mar 2016 09:00:16 GMT
On Fri, 2016-03-11 at 01:20 -0700, jappy wrote:
> How does stale check actually work? By following the code it leads me to
> SessionInputBufferImpl class
> and there it is trying to read some data from the buffer.
> What data is it trying to read? How do we actually say that this connection
> is stale and close it?
> 

Stale connection check is necessary to compensate for a limitation of
the classic (blocking) i/o model of Java. Sockets in blocking i/o mode
can only react to TCP packets when performing an i/o operation. When
kept alive inside a connection pool connections are idle. They are not
able to react to any action of the opposite endpoint.

Stale check is effectively a very brief read operation with an extremely
low timeout (1ms). If the operation times out the connection is fine. If
it fails the connection is no longer valid.

Please consider upgrading to 4.5.2

Oleg

> The context behind this is we are seeing nearly 10K socket exceptions per
> minute on our box.
> and it all happens when it checks for stale connections and then trace ends
> with a SocketTimeoutException
> 
> Our setup is pretty simple. We have 10 different routes. With 5 max per
> route. If I do a netstat on my box 
> I can see exactly 50 TCP connections on my box all in ESTABLISHED state. But
> the above SocketTimeoutException doesn't make sense. As it all bubbles up in
> checking for stale connections so wanted to know how it worked. 
> 
> Thanks in advance.
> 
> 
> 
> --
> View this message in context: http://httpcomponents.10934.n7.nabble.com/4-3-3-Newbie-question-about-Stale-Check-tp28119.html
> Sent from the HttpClient-User mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> 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