RFR: 8208693: HttpClient: Extend the request timeout's scope to cover the response body [v7]

Daniel Fuchs dfuchs at openjdk.org
Mon Nov 3 13:03:28 UTC 2025


On Mon, 3 Nov 2025 12:24:50 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!)
>
> Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Simplify Javadoc

src/java.net.http/share/classes/java/net/http/HttpRequest.java line 282:

> 280:          * @throws IllegalArgumentException if the duration is non-positive
> 281:          * @see HttpClient.Builder#connectTimeout(Duration) Configuring
> 282:          * timeout for connection establishment

Same here - please verify how this looks in generated API doc

test/jdk/java/net/httpclient/TimeoutResponseTestSupport.java line 187:

> 185:         }
> 186: 
> 187:         private static HttpServerAdapters.HttpTestServer createServer(

Can we use imports to reduce the long class names please

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/27469#discussion_r2486383526
PR Review Comment: https://git.openjdk.org/jdk/pull/27469#discussion_r2486403677


More information about the net-dev mailing list