RFR: 8208693: HttpClient: Extend the request timeout's scope to cover the response body
Volkan Yazici
vyazici at openjdk.org
Wed Oct 22 11:54:37 UTC 2025
On Tue, 30 Sep 2025 17:34:43 GMT, Volkan Yazici <vyazici at openjdk.org> wrote:
>> Currently `HttpRequest::timeout` only applies until the response headers are received. Extend its scope to also cover the consumption of the response body.
>>
>> ### Review guidelines
>>
>> 1. Read _"the fix"_ in `MultiExchange`
>> 2. Skim through the test server *handler* in `TimeoutResponseTestSupport`
>> 3. Review first `TimeoutResponseHeaderTest`, and then `TimeoutResponseBodyTest` (Mind the multiple `@test` blocks!)
>
> src/java.net.http/share/classes/jdk/internal/net/http/Http3ExchangeImpl.java line 1341:
>
>> 1339: if (!responseReceived && resetError == Http3Error.H3_REQUEST_REJECTED) {
>> 1340: exchange.markUnprocessedByPeer();
>> 1341: }
>
> Without this, server handler's `exchange.resetStream(Http3Error.H3_REQUEST_REJECTED.code())` results in client to fail the request, instead of retrying it. I am not sure if `H3_REQUEST_REJECTED` is the only error code we should guard against.
Figured the problem is more convoluted than it appears. @jaikiran will soon land a PR adressing this issue. I will hold this PR until then.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27469#discussion_r2407905198
More information about the net-dev
mailing list