RFR: 8297200: java/net/httpclient/SpecialHeadersTest.java failed once in AssertionError due to selector thread remaining alive [v4]
Daniel Fuchs
dfuchs at openjdk.org
Mon Nov 28 16:49:46 UTC 2022
On Mon, 28 Nov 2022 15:47:48 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:
> So perhaps that means the selector manager thread has just started (and marked itself as alive) but hasn't yet reached the `selector.select` statement when the tracker checked if it was alive? Looking at the code that seems possible and perhaps explains why shortly later the tracker in its logging noted that the selector manager is no longer alive. This would then mean that the tracker is (and will always?) be inherently racy, isn't it?
See explanation above: when we started the wait loop, the thread had not started yet, so the tracker believed it had already exited, and stopped waiting. But before the checks were performed, the thread had started and isAlive was true, which caused the assertion error: the test was no longer waiting for shutdown at this point - it had already exited the waiting loop without waiting. Adding timeout debug in the reference tracker is what allowed me to understand the issue, as I could see that the reference tracker had not waited at all, and the timeout had not been honored.
-------------
PR: https://git.openjdk.org/jdk/pull/11294
More information about the net-dev
mailing list