[9] RFR: 8164166: Make sure java/nio/channels tests shutdown asynchronous channel groups

Artem Smotrakov artem.smotrakov at oracle.com
Tue Aug 23 00:28:14 UTC 2016


Hello,

Please review the following patch for a couple of java/nio/channels tests.

A couple of test failures have been observed, and jstack reported many 
daemon threads which were not related to failed tests (please see see 
JDK-8162757 and JDK-8162757 for details).

The daemon threads were running EPollPort.EventHandlerTask class. I 
found a number of tests which run in agent VM, and start such daemon 
threads by opening an AsynchronousChannelGroup. If I understand 
correctly, those daemon threads are supposed to stop by calling 
AsynchronousChannelGroup.shutdown() method. I noticed that some tests 
don't guarantee that asynchronous channel groups are always shutdown. 
Please see more details in the bug.

The patch below updates java/nio/channel tests for 
AsynchronousChannelGroup to always shutdown groups. As an enhancement, 
it updates the tests to use try-with-resources block in a couple of places.

I am not familiar with EPollPort class, but at first glance, the logic 
looks quite complex. If EPollPort.EventHandlerTask daemon threads still 
appear after this patch, then there may be a bug in NIO (something may 
get out of sync while shutting down the daemon threads).

Bug: https://bugs.openjdk.java.net/browse/JDK-8164166
Webrev: http://cr.openjdk.java.net/~asmotrak/8164166/webrev.00/

Artem


More information about the nio-dev mailing list