On Fri, 28 Aug 2026 14:55:51 GMT, Daniel Fuchs <[email protected]> wrote:

>> src/java.net.http/share/classes/jdk/internal/net/http/Http2Connection.java 
>> line 674:
>> 
>>> 672:         stateLock.lock();
>>> 673:         try {
>>> 674:             return finalStream() && isIdle();
>> 
>> Note that previously we weren't checking against `numReservedServerStreams 
>> == 0`, now we do.
>
> I am not sure it's a good idea to do that. There should not be any server 
> reserved streams if there is no client streams for HTTP/2, because push 
> promises are supposed to be created while the main response stream is still 
> open.

How would you advise me to proceed with?

Note that `isIdle()` is used in other places than `shouldClose()`. I'm inclined 
to have a single generic idleness check and have it employed wherever 
necessary, instead of each caller rolling out its own `streams.isEmpty() && 
numReservedClientStreams == 0 ...` checks.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/32545#discussion_r3892940022

Reply via email to