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

Alan Bateman alanb at openjdk.org
Tue Oct 25 14:36:49 UTC 2022


On Tue, 25 Oct 2022 12:35:15 GMT, Darragh Clarke <duke at openjdk.org> wrote:

> Added logging to SelectWhenRefused for an intermittent failure caused by unexpected wakeups, this includes trying to receive data if there is any available to identify where it is coming from.
> 
> I also set the test to run in othervm mode which should reduce the chances of this failure happening in the first place.

> @AlanBateman If we reach here the key is both valid and readable so shouldn't there be something to receive, even if the channel is non-blocking?

It's okay to print the selection key (singular).  The useful part of the change is to do the non-blocking receive and print the sender's socket address when not null. If it trips then it may help identify where the datagram is coming from. That is, I assume the theory here is that some other test is using the "refuser" port (the port that dc1.closer released). The alternative is to just retry when there is interference, which I think you were suggesting in one of the comments.

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

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


More information about the nio-dev mailing list