RFR: 8297424: java/net/httpclient/AsyncExecutorShutdown.java fails in AssertionError due to misplaced assert
Daniel Fuchs
dfuchs at openjdk.org
Fri Nov 25 10:22:11 UTC 2022
On Fri, 25 Nov 2022 06:26:25 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:
> This PR also has changes in the `Stream` class. Some of those changes are typo related fixes, so that's fine. However, it also has other functional changes. Is that intentional and related?
These are changes I made when investigating the fix, and they are not related. The `pendingResponseSubscriber` is a temporary field that holds the subscriber value until the `responseSubscriber` is handled and subscribed by the `schedule` loop. It is a bit confusing to see a non null `pendingResponseSubscriber` after it has been handled by that loop. Practically, setting it to `null` or leaving it assigned at this point should have no effect on the behavior of this class... Hmmm... except I see ternary operators that first look at the subscriber and then at the pending subscriber. So this change now introduce a potential race condition if they are executed concurrently with the `schedule` loop. Good observation. I will revert that.
-------------
PR: https://git.openjdk.org/jdk/pull/11332
More information about the net-dev
mailing list