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

Daniel Fuchs dfuchs at openjdk.org
Fri Nov 7 09:55:05 UTC 2025


On Fri, 7 Nov 2025 08:25:47 GMT, Volkan Yazici <vyazici at openjdk.org> wrote:

>> src/java.net.http/share/classes/jdk/internal/net/http/MultiExchange.java line 391:
>> 
>>> 389:             // Ensure that the connection is closed or returned to the pool
>>> 390:             exch.nullBody(response, throwable);
>>> 391:         });
>> 
>> This might not be the correct place. Shouldn't we instead call `cancelTimer()` as soon as we know there won't be a body, after line 405 below, so that we are sure the timer is cancelled even in the case where a body not permitted is present?
>
>> after line 405 below
> 
> @dfuch, do you mean right after the `if (bodyNotPermitted(r)) {` line? (Sorry, I find line numbers difficult to track in the flux of changes.)

if (bodyNotPermitted(r)) {
                            if (bodyIsPresent(r)) {

between these two lines :-)

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

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


More information about the net-dev mailing list