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

Volkan Yazici vyazici at openjdk.org
Mon Nov 3 14:42:29 UTC 2025


On Mon, 3 Nov 2025 14:36:26 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 with a new target base due to a merge or a rebase. The pull request now contains 31 commits:
> 
>  - Shorten `TimeoutResponseTestSupport` using imports
>  - Make `MultiExchange::cancelTimer` package-private
>  - Merge remote-tracking branch 'upstream/master' into respBodyTime
>  - Simplify Javadoc
>  - Merge remote-tracking branch 'upstream/master' into respBodyTime
>  - Improve `HttpBodySubscriberWrapper::onTermination` JavaDoc
>  - Mark `SubscriptionWrapper` as `final`
>  - Replace wrapper's `preTerminationCallback` argument with a method to be extended
>  - Fix `HttpClient` doc typo
>  - Invoke `preTerminationCallback` at `cancel()` too
>  - ... and 21 more: https://git.openjdk.org/jdk/compare/ef464d69...55396846

src/java.net.http/share/classes/java/net/http/WebSocket.java line 151:

> 149:          * moment a connection is requested until it is established. The elapsed
> 150:          * time includes any SSL/TLS handshake.
> 151:          *

Generated output LGTM:
<img width="879" height="373" alt="image" src="https://github.com/user-attachments/assets/51159fad-0134-4b5d-bb78-22bb91db5108" />

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

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


More information about the net-dev mailing list