hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: Should HC retry all SocketExceptions?
Date Wed, 31 Aug 2011 08:59:59 GMT
On Tue, 2011-08-30 at 21:47 +0100, sebb wrote:
> On 30 August 2011 21:06, sebb <sebbaz@gmail.com> wrote:
> > The method DefaultHttpRequestRetryHandler.retryRequest currently
> > retries IOExceptions which are not:
> >
> > InterruptedIOException
> > UnknownHostException
> > ConnectException
> > SSLException
> >
> > However, this includes exceptions such as the following:
> >
> > org.apache.http.impl.client.DefaultHttpClient: I/O exception
> > (java.net.SocketException) caught when processing request: socket
> > closed
> > org.apache.http.impl.client.DefaultHttpClient: Retrying request
> >
> > and
> >
> > org.apache.http.impl.client.DefaultHttpClient: I/O exception
> > (java.net.BindException) caught when connecting to the target host:
> > Address already in use: connect
> > org.apache.http.impl.client.DefaultHttpClient: Retrying connect
> >
> > which seems wrong (but perhaps I am wrong).
> >

Yes, this is wrong. In both cases the exception should not have been
retried.


> > I discovered this because JMeter currently uses Socket.close() to
> > interrupt an active sample. Probably there is a better way to do this.
> 
> Sorry, that's misleading - JMeter uses HttpUriRequest.abort() which
> presumably uses Socket.close() internally, judging by the log
> messages.
> 
> In fact, looking at the code for abort(), that sets the boolean
> aborted, but nothing seems to use the flag, as I could not find any
> references to the method isAborted().
> 
> Presumably the code in DefaultHttpRequestRetryHandler.retryRequest() -
> or perhaps DefaultRequestDirector.tryExecute() - ought to take that
> into account?
> 
> Is there perhaps other code that needs to check isAborted()?
> 

At the very least DefaultHttpRequestRetryHandler#retryRequest should
take it into account. 

Please raise a JIRA for this issue.

cheers

Oleg



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


Mime
View raw message