hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "KARR, DAVID (ATTSI)" <dk0...@att.com>
Subject RE: With HttpClient 3.0.1, is there some situation where setting the "SoTimeout" would be ignored?
Date Tue, 06 Jul 2010 20:49:24 GMT
> -----Original Message-----
> From: Oleg Kalnichevski [mailto:olegk@apache.org]
> Sent: Tuesday, May 18, 2010 3:04 PM
> To: HttpClient User Discussion
> Subject: Re: With HttpClient 3.0.1, is there some situation where
> setting the "SoTimeout" would be ignored?
> 
> On Tue, 2010-05-18 at 14:36 -0700, KARR, DAVID (ATTSI) wrote:
> > I'm looking at a situation where I'm setting the "SoTimeout" in
> > HttpClientParams to 90000 (90 seconds).  This makes a call to a web
> > service that under certain circumstances takes quite a while to
> > complete, and sometimes times out.  In fact, the data in my log file
> > indicates that I often get start-to-return intervals of just about
> 120
> > seconds.  If the back-end server is still working on the request
> after
> > 90 seconds, will HttpClient be able to cause the request to abort?
> >
> 
> David,
> 
> The setting is not ignored, rather your expectation is wrong. The
> socket
> timeout is the maximum period of inactivity between two _consecutive_
> data transmissions. As long as the server sends a packet every 90
> seconds the request will not time out.
> 
> Hope this clarifies things a little

I'm getting back to examining this issue again.

I may need to implement a way to actually force the connection to terminate with prejudice
after our "read timeout" value, so that we're interpreting that "read timeout" for the entire
transaction, not just for a single packet.  Is there an obvious way to implement something
like this?

I noticed the "closeIdleConnections()" method in "SimpleHttpConnectionManager".  If I have
a background thread call this if it has passed its timeout value, would that work?  I assume
I would implement this with a blocking queue holding HttpClient objects along with their start
time.
Mime
View raw message