RFR: 8348108: Race condition in AggregatePublisher.AggregateSubscription [v2]

Daniel Fuchs dfuchs at openjdk.org
Tue Jan 21 16:04:19 UTC 2025


On Tue, 21 Jan 2025 15:28:10 GMT, Jaikiran Pai <jpai at openjdk.org> 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 two additional commits since the last revision:
>> 
>>  - Merge branch 'master' into AggregatePublisher-8348108
>>  - 8348108: Race condition in AggregatePublisher.AggregateSubscription
>
> test/jdk/java/net/httpclient/AggregateRequestBodyTest.java line 432:
> 
>> 430:             items.addLast(item);
>> 431:             int available = semaphore.availablePermits();
>> 432:             if (semaphore.availablePermits() > Integer.MAX_VALUE - 8) {
> 
> In context of reporting the `available` value in the exception message thta gets thrown in the next line, should this check have used the local variable `available` or does it not matter?

Oh! My mistake. I introduced the variable specifically for this, but didn't update all the places. Thanks for noticing. Not that it matters much, we won't reach Integer.MAX_VALUE - 8 in this test anyway :-)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23204#discussion_r1923989246


More information about the net-dev mailing list