On Thu, 5 Nov 2026 10:13:38 GMT, Volkan Yazici <[email protected]> wrote:
>> Daniel Fuchs has updated the pull request with a new target base due to a
>> merge or a rebase. The incremental webrev excludes the unrelated changes
>> brought in by the merge/rebase. The pull request contains five additional
>> commits since the last revision:
>>
>> - Review feedback: no need for requestBodySuccessfullySent(); add tests
>> with delayed request body publication
>> - Merge branch 'master' into H2GoAwayPromptConnectionClose-8396058
>> - Remove hacky reproducer
>> - Uncomment hacky reproducer
>> - 8396058:
>> test/jdk/java/net/httpclient/http2/H2GoAwayPromptConnectionClose.java may
>> fail intermittently if responseSubscriber is still null when connection
>> close is processed
>
> src/java.net.http/share/classes/jdk/internal/net/http/Stream.java line 1542:
>
>> 1540: private boolean requestBodySuccessfullySent() {
>> 1541: if (requestPublisher == null) return true;
>> 1542: return requestBodyCF.isDone() &&
>> !requestBodyCF.isCompletedExceptionally();
>
> I think we need to amend this check for `requestContentLen == 0`:
>
> Suggestion:
>
> return requestPublisher == null ||
> requestContentLen == 0 ||
> (requestBodyCF.isDone() &&
> !requestBodyCF.isCompletedExceptionally());
>
>
> I'll DM you a test reproducing this issue.
Ah! Good remark.
I have experimented with @djelinski suggestion here, which has the advantage of
side-stepping this issue. If we complete requestBodyCF instead there's no need
to check whether it's already completed, and this whole method can go away. The
exceptional case will be handled by the scheduler's loop.
I have pushed a change that does that, and added additional tests for the case
where the request body is not yet fully sent when all the response bytes are
received and the connection is closed.
> src/java.net.http/share/classes/jdk/internal/net/http/Stream.java line 1547:
>
>> 1545: void connectionClosing(Throwable cause) {
>> 1546: boolean runScheduler = false;
>> 1547: inputQLock.lock();
>
> You may consider documenting the rationale for holding the `inputQLock` here.
I will double check whether this is still needed.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/33697#discussion_r4482928084
PR Review Comment: https://git.openjdk.org/jdk/pull/33697#discussion_r4482943838