8200256: java/nio/channels/AsynchronousChannelGroup/Basic.java fails intermittently

Alan Bateman Alan.Bateman at oracle.com
Mon Mar 26 18:39:34 UTC 2018


This test has been failing recently on macOS and Linux with "Group 
should have terminated" when testing the shutdown of a channel group. 
Chris and others working on the HTTP client API have had several 
sightings during their testing.

The issue turns out to be a regression in channel group shutdown 
implementation. When woken up, a thread should read a single byte from 
the wakeup pipe but recent changes means it may consume more bytes, thus 
leaving other threads waiting for an event. Easy fix to change this code 
back to reading one byte. With this fix, the test runs 1M times for me 
without an issue. Without the fix then it usually fails in 50000 runs or 
less.

The webrev with the change is here:
    http://cr.openjdk.java.net/~alanb/8200256/webrev/index.html

-Alan


More information about the nio-dev mailing list