RFR: 8293696: java/nio/channels/DatagramChannel/SelectWhenRefused.java fails with "Unexpected wakeup" [v2]

Daniel Fuchs dfuchs at openjdk.org
Thu Oct 27 18:07:29 UTC 2022


On Thu, 27 Oct 2022 16:46:28 GMT, Mark Sheppard <msheppar at openjdk.org> wrote:

> I would suggest the initial focus for the changes should be for diagnostics of the failed scenario, and determing whether the selector returns actually reflect some input read event and not another spurious "low level event trigger".

Given the intermittent nature of the failure I'd rather do both at the same time. If we do receive a datagram, when we expect none, and we do verify that the datagram doesn't come from this test (it doesn't contain "Greetings!") then I'd argue that it must come from somewhere else (whatever that somewhere is) and it's safe to respin and try again.

There might be some subtle issues to fix in the retry logic though. I believe we should respin when getting unexpected wake ups only if we actually manage to read a datagram - for instance, and that we can assert that this datagram is not ours (and it should never be, since we sent it to a refuser that has a different port than our receiver).
We should fail in all other cases.

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

PR: https://git.openjdk.org/jdk/pull/10851


More information about the nio-dev mailing list