[
https://issues.apache.org/jira/browse/HTTPCLIENT-2359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17922078#comment-17922078
]
Arturo Bernal commented on HTTPCLIENT-2359:
-------------------------------------------
I believe this is a regression because [RFC 9110 (Section
9.2.2)|https://datatracker.ietf.org/doc/html/rfc9110#section-9.2.2] states:
_'Idempotent methods are distinguished because the request can be repeated
automatically if a communication failure occurs before the client is able to
read the server's response.'_ .
> Retry HTTP requests if server closes connection before sending status line as
> per RFC 2068, 8.2
> -----------------------------------------------------------------------------------------------
>
> Key: HTTPCLIENT-2359
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2359
> Project: HttpComponents HttpClient
> Issue Type: Improvement
> Components: HttpClient (classic)
> Affects Versions: 4.5.14
> Reporter: Vladimir Sitnikov
> Priority: Major
>
> See https://www.rfc-editor.org/rfc/rfc2068#section-8.2
> {quote}if an HTTP/1.1 client has seen an HTTP/1.1 or
> later response from the server, and it sees the connection close
> before receiving any status from the server, the client SHOULD retry
> the request without user interaction so long as the request method is
> idempotent (see section 9.1.2); other methods MUST NOT be
> automatically retried, although user agents MAY offer a human
> operator the choice of retrying the request..{quote}
> I'm not an expert in HTTP / RFC, however, it looks like Httpclient should
> retry idempotent methods in case it receives EOF instead of a status line.
> As far as I understand, the only way to configure Httpclient to detect closed
> connections is to configure {{connectionManager.setValidateAfterInactivity}},
> however, it is more like a workaround since the server can close connections
> at arbitrary time (e.g. it can even close the connections within a couple of
> seconds if there's a huge connection demand).
> I suggest Httpclient should implement rfc2068, and it should retry
> (reconnect) in case it observes EOF before receiving the status line.
> Here's a use-case from Apache JMeter (including tcp dumps from both
> Httpclient and Firefox):
> https://github.com/apache/jmeter/issues/6330#issuecomment-2621285050
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]