RFR: 8326498: java.net.http.HttpClient connection leak using http/2 [v2]

Daniel Fuchs dfuchs at openjdk.org
Wed Nov 12 12:42:28 UTC 2025


On Wed, 12 Nov 2025 08:28:46 GMT, Daniel Jeliński <djelinski at openjdk.org> wrote:

>> Jaikiran Pai has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - mark jdk.internal.net.http.Http2Connection as Closable
>>  - reduce number of concurrent requests
>
> src/java.net.http/share/classes/jdk/internal/net/http/Http2Connection.java line 1247:
> 
>> 1245:      */
>> 1246:     final boolean isOpen() {
>> 1247:         return this.connTerminator.terminationCause.get() == null && connection.channel().isOpen();
> 
> Can we ever observe a situation where channel is not open but termination cause is not set?
> 
> As far as I could tell, channel.isOpen only returns false after close() is called, and close() is only called from doTerminate after the termination cause is set. What am I missing?

A channel can be closed by the peer. So it may be closed even if close() has not been called.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28233#discussion_r2518154884


More information about the net-dev mailing list