hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: Should HC retry all SocketExceptions?
Date Tue, 30 Aug 2011 20:47:28 GMT
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).
>
> 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()?

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


Mime
View raw message