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

Darragh Clarke duke at openjdk.org
Thu Oct 27 09:34:24 UTC 2022


On Tue, 25 Oct 2022 14:14:05 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

> One improvement that could be done is put the whole code from line 55 to line 94 into a loop and respin if we get a datagram that doesn't correspond to what was sent to the refuser. It could be that we are receiving a datagram from something/somewhere else in which case we could just ignore it, clear all keys, and go back to line 55. Otherwise throw if we detected an error or break the loop if everything occurred as expected.


I think that this would be good, but because of the nature of the refuser, would we be reliably able to read datagrams sent, since they should be getting refused and throwing an exception before they can be read?

If they can be read, I could change the logUnexpectedWakeup method to return a boolean for whether its local or not since it attempts to read it already

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

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


More information about the nio-dev mailing list