RFR: 8317808: HTTP/2 stream cancelImpl may leave subscriber registered [v2]

Daniel Fuchs dfuchs at openjdk.org
Fri Oct 13 14:03:16 UTC 2023


On Fri, 13 Oct 2023 13:41:10 GMT, Michael McMahon <michaelm at openjdk.org> wrote:

>> Daniel Fuchs has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Simplify the fix
>
> src/java.net.http/share/classes/jdk/internal/net/http/HttpClientImpl.java line 584:
> 
>> 582:                     }
>> 583:                     return false;
>> 584:                 }
> 
> Is this change here actually part of the fix, or something else that needed to be fixed?

A bit of both. I was looking at why the subscriber didn't get properly unregistered and stumbled on this small issue. Tests showed that it wasn't sufficient to fix the issue so I continued debugging.
The semantics of the method is that it should return `true` only if the subscriber was added to the list, so it really should have returned `false` here, and `true` only if `subscribers.add` was called and returned `true`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16144#discussion_r1358300558


More information about the net-dev mailing list