hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sylvain Laurent (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HTTPCLIENT-886) Incorrect handling of NoHttpResponseException in DefaultHttpMethodRetryHandler
Date Wed, 04 Nov 2009 13:45:32 GMT

    [ https://issues.apache.org/jira/browse/HTTPCLIENT-886?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12773482#action_12773482
] 

Sylvain Laurent commented on HTTPCLIENT-886:
--------------------------------------------

I agree with you about implementing detection for duplicate, but I don't agree that the behavior
in case of NoHttpResponseException should be to retry. As my case shows, there is a possibility
that the request was actually sent to the back-end, so no retry should be attempted (better
safe than sorry).
In the case of a java.net.ConnectException it' safe to retry because the client did not send
the request, and we are sure of it.

> Incorrect handling of NoHttpResponseException in DefaultHttpMethodRetryHandler
> ------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-886
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-886
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>    Affects Versions: 3.1 Final
>            Reporter: Sylvain Laurent
>            Priority: Critical
>
> We have a buggy load-balancer that sometimes forwards the request to the back-end server,
and then close the connections without returning any data at all.
> This provokes a NoHttpResponseException inside commons http client 3.1, which is handled
by DefaultHttpMethodRetryHandler.
> Unfortunately DefaultHttpMethodRetryHandler handles this NoHttpResponseException by asking
for a retry. In our case, this is very dangerous because the request has already been sent
and is being processed by the back-end server.
> I think that in the case of a NoHttpResponseException the test !method.isRequestSent()
shoud be done :
>         if (exception instanceof NoHttpResponseException && !method.isRequestSent())
{
>             // Retry if the server dropped connection on us AND the request was not sent
>             return true;
>         }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


Mime
View raw message