You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by La...@videotron.com on 2011/01/26 16:27:13 UTC

How to prevent retry on time out while waiting for response

Hi,

I have a servlet which, when run, can take up to 15 minutes to provide a 
reply. This servlet contains a sanity check which returns an error code if 
it is called while another instance is running.

When I call this servlet using httpclient (4.0.3 // httpcore 4.1), 10 
minutes after the initial call I get my "Trying to run two instances of 
the servlet" message. This doesn't happen in a browser. It looks like 
httpclient is reloading the URL after 10 minutes.

I tried changing the various timeout values with no change in behaviour:

HttpParams httpParams = new BasicHttpParams();
HttpConnectionParams.setConnectionTimeout(httpParams, new 
Integer(1200000));
HttpConnectionParams.setSoTimeout(httpParams, new Integer(1200000));
 
DefaultHttpClient httpclient = new DefaultHttpClient(httpParams);

What am I missing?
        
L

P.S. Sorry if this comes out in HTML. I can't figure out how  to change it 
with Notes 7.



Re: RE How to prevent retry on time out while waiting for response

Posted by La...@videotron.com.
Thanks, I tried with loogging and I get this:

2011/01/26 11:36:17:007 EST [DEBUG] headers - >> Connection: Keep-Alive
2011/01/26 11:46:17:030 EST [DEBUG] DefaultClientConnection - Receiving 
response: HTTP/1.1 200 OK
2011/01/26 11:46:17:031 EST [DEBUG] headers - << HTTP/1.1 200 OK
2011/01/26 11:46:17:031 EST [DEBUG] headers - << Date: Wed, 26 Jan 2011 
16:36:17 GMT
2011/01/26 11:46:17:031 EST [DEBUG] headers - << Server: IBM_HTTP_Server
2011/01/26 11:46:17:031 EST [DEBUG] headers - << Accept-Ranges: bytes
2011/01/26 11:46:17:031 EST [DEBUG] headers - << Pragma: no-cache
2011/01/26 11:46:17:031 EST [DEBUG] headers - << Cache-Control: no-cache
2011/01/26 11:46:17:031 EST [DEBUG] headers - << Expires: now
2011/01/26 11:46:17:031 EST [DEBUG] headers - << Content-Length: 366
2011/01/26 11:46:17:031 EST [DEBUG] headers - << Keep-Alive: timeout=10, 
max=100
2011/01/26 11:46:17:031 EST [DEBUG] headers - << Connection: Keep-Alive
2011/01/26 11:46:17:031 EST [DEBUG] headers - << Content-Type: 
text/xml;charset=ISO-8859-1
2011/01/26 11:46:17:032 EST [DEBUG] headers - << Content-Language: en
2011/01/26 11:46:17:038 EST [DEBUG] DefaultHttpClient - Connection can be 
kept alive for 10000 ms
2011/01/26 11:46:17:042 EST [DEBUG] SingleClientConnManager - Releasing 
connection 
org.apache.http.impl.conn.SingleClientConnManager$ConnAdapter@1be0f0a

So it looks like a server-side bug, unless I'm misreading the output. I'll 
verify with the server admins.

Laurent Duperval
514 380-4324






Oleg Kalnichevski <ol...@apache.org> 
2011-01-26 11:29
Veuillez répondre à
"HttpClient User Discussion" <ht...@hc.apache.org>


A
HttpClient User Discussion <ht...@hc.apache.org>
cc

Objet
Re: RE How to prevent retry  on time out while waiting for response






On Wed, 2011-01-26 at 11:14 -0500, Laurent.Duperval@videotron.com wrote:
> Let me just add that I tried a much shorter timeout (20 seconds) and 
that 
> makes the process fail much more rapidly.
> 
> I'm also investigating whether the fact that the httpclient call is 
> executed within a thread has any effect.

Laurent

HttpClient should not retry automatically if the request fails due to a
time out. Nevertheless, you can find out whether this is indeed the case
by running your application with the context logging turned on.

Hope this helps

Oleg 


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



Re: RE How to prevent retry on time out while waiting for response

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Wed, 2011-01-26 at 11:14 -0500, Laurent.Duperval@videotron.com wrote:
> Let me just add that I tried a much shorter timeout (20 seconds) and that 
> makes the process fail much more rapidly.
> 
> I'm also investigating whether the fact that the httpclient call is 
> executed within a thread has any effect.

Laurent

HttpClient should not retry automatically if the request fails due to a
time out. Nevertheless, you can find out whether this is indeed the case
by running your application with the context logging turned on.

Hope this helps

Oleg  


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


RE How to prevent retry on time out while waiting for response

Posted by La...@videotron.com.
Let me just add that I tried a much shorter timeout (20 seconds) and that 
makes the process fail much more rapidly.

I'm also investigating whether the fact that the httpclient call is 
executed within a thread has any effect.

Laurent Duperval
514 380-4324