RFR: 8293696: java/nio/channels/DatagramChannel/SelectWhenRefused.java fails with "Unexpected wakeup"
Mark Sheppard
msheppar at openjdk.org
Tue Oct 25 13:23: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.
test/jdk/java/nio/channels/DatagramChannel/SelectWhenRefused.java line 57:
> 55: sendDatagram(dc, refuser);
> 56: int n = sel.select(2000);
> 57: if (n > 0) {
This has been seen as the location of the intermittent failures, so maybe adding a receive here also to determine the src of the unexpected datagram would be informative
test/jdk/java/nio/channels/DatagramChannel/SelectWhenRefused.java line 77:
> 75: n = dc.read(buf);
> 76: String message = new String(buf.array());
> 77: System.out.format("received %s at %s%n", message, dc.getLocalAddress());
The intermittent failure is seen on the previous test scenario, so some diagnostics relating to that are of interest
I think we are interested in the sender detail here ... where did the stray datagram come from, which would necessitate invoking receive on the datagram channel ... but as of yet there has been no failures observed here afaik
Also prior to each DC send it could be worth invoking selectNow on the selector to disperse any stray pending events on the low level OS "select"
-------------
PR: https://git.openjdk.org/jdk/pull/10851
More information about the nio-dev
mailing list