8003253: TEST_BUG: java/nio/channels/AsynchronousChannelGroup/Unbounded.java hang intermittently [win] (original) (raw)

Alan Bateman Alan.Bateman at oracle.com
Mon Nov 12 11:55:45 PST 2012


Daniel Fuchs pinged me to say that this started failing intermittently him on Mac as soon as I pushed the change for 8003253.

Mea culpa, the patch does bring a problem. At the end of the test the listener is closely and this the outstanding accept to fail with an AsycnhronousCloseException and so sets "failed" to true. This creates a race in that the main thread may see failed as true and fails the test.

I've created a new bug for this, 8003285, and the patch to fix this is attached. If someone can review then we can sweep this one under the carpet before anyone else notices.

-Alan

diff --git a/test/java/nio/channels/AsynchronousChannelGroup/Unbounded.java b/test/java/nio/channels/AsynchronousChannelGroup/Unbounded.java --- a/test/java/nio/channels/AsynchronousChannelGroup/Unbounded.java +++ b/test/java/nio/channels/AsynchronousChannelGroup/Unbounded.java @@ -39,6 +39,9 @@ // set to true if an I/O operation fails static volatile boolean failed;

@@ -54,8 +57,10 @@ listener.accept((Void)null, this); } public void failed(Throwable exc, Void att) {

@@ -120,8 +125,11 @@ // wait for all threads to reach the barrier System.out.println("Waiting for all threads to reach barrier"); barrier.await(); +

details");

for details"); } }



More information about the nio-dev mailing list