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

Michael McMahon michaelm at openjdk.org
Thu Oct 30 16:20:22 UTC 2025


On Wed, 29 Oct 2025 14:27: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!)
>
> Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Replace wrapper's `preTerminationCallback` argument with a method to be extended

src/java.net.http/share/classes/java/net/http/HttpClient.java line 315:

> 313:          * implementation applies it to the entire connection phase, from the
> 314:          * moment a connection is requested until it is established. The
> 315:          * elapsed time includes any SSL/TLS handshake.

Suggestion:

         * A connection timeout applies to the entire connection phase, from the
         * moment a connection is requested until it is established. The
         * elapsed time includes any SSL/TLS handshake.

This is a suggested simplification. If acceptable it could be applied to the same doc pattern elsewhere.

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

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


More information about the net-dev mailing list