JDK-8153209 : java/nio/channels/AsyncCloseAndInterrupt.java fails throwing exception: java.nio.channels.ClosedChannelException
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.nio
  • Affected Version: 9
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris
  • CPU: sparc
  • Submitted: 2016-03-31
  • Updated: 2016-07-28
  • Resolved: 2016-04-12
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b115Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Description
SocketChannel/read/close
java.lang.Exception: SocketChannel/read/close threw an exception
	at TestThread.finishAndThrow(TestThread.java:80)
	at AsyncCloseAndInterrupt.test(AsyncCloseAndInterrupt.java:606)
	at AsyncCloseAndInterrupt.test(AsyncCloseAndInterrupt.java:626)
	at AsyncCloseAndInterrupt.test(AsyncCloseAndInterrupt.java:636)
	at AsyncCloseAndInterrupt.main(AsyncCloseAndInterrupt.java:697)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(java.base@9-ea/Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(java.base@9-ea/NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(java.base@9-ea/DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(java.base@9-ea/Method.java:531)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:110)
	at java.lang.Thread.run(java.base@9-ea/Thread.java:804)
Caused by: java.nio.channels.ClosedChannelException
	at sun.nio.ch.SocketChannelImpl.ensureReadOpen(java.base@9-ea/SocketChannelImpl.java:260)
	at sun.nio.ch.SocketChannelImpl.read(java.base@9-ea/SocketChannelImpl.java:303)
	at AsyncCloseAndInterrupt$10.doIO(AsyncCloseAndInterrupt.java:262)
	at AsyncCloseAndInterrupt$Tester.go(AsyncCloseAndInterrupt.java:486)
	at TestThread.run(TestThread.java:55)

DatagramChannel/read/close
java.lang.Exception: DatagramChannel/read/close threw an exception
	at TestThread.finishAndThrow(TestThread.java:80)
	at AsyncCloseAndInterrupt.test(AsyncCloseAndInterrupt.java:606)
	at AsyncCloseAndInterrupt.test(AsyncCloseAndInterrupt.java:626)
	at AsyncCloseAndInterrupt.test(AsyncCloseAndInterrupt.java:636)
	at AsyncCloseAndInterrupt.main(AsyncCloseAndInterrupt.java:735)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(java.base@9-ea/Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(java.base@9-ea/NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(java.base@9-ea/DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(java.base@9-ea/Method.java:531)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:110)
	at java.lang.Thread.run(java.base@9-ea/Thread.java:804)
Caused by: java.nio.channels.ClosedChannelException
	at sun.nio.ch.DatagramChannelImpl.ensureOpen(java.base@9-ea/DatagramChannelImpl.java:323)
	at sun.nio.ch.DatagramChannelImpl.read(java.base@9-ea/DatagramChannelImpl.java:541)
	at AsyncCloseAndInterrupt$10.doIO(AsyncCloseAndInterrupt.java:262)
	at AsyncCloseAndInterrupt$Tester.go(AsyncCloseAndInterrupt.java:486)
	at TestThread.run(TestThread.java:55)

Only changeset associated to this build corresponds to https://bugs.openjdk.java.net/browse/JDK-8153027: "Exclude tools/jimage/JImageTest.java" which seems to have nothing to do with this intermittent networking test issue.

The following change set was intended to increase stability of the test, we need to inspect it (JDK-8151582).
http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/88577677aec9

Comments
RFR: http://mail.openjdk.java.net/pipermail/nio-dev/2016-April/003614.html jprt results: http://scaaa637.us.oracle.com/archive/2016/04/2016-04-05-114717.oracle.dev/logs/ run locally with 1000 run without failure.
06-04-2016

Root cause: for JDK-8068693, 500ms is too short on busy system for channel to be closed or for thread blocking on IO to be interrupted. for JDK-8153209, it's a test regression due to JDK-8151582 (http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/88577677aec9). There is a time window between thread ready and io operation ready, deleting the original sleep(100) might cause channel closed before accessing the channel. Suggested Fix: for JDK-8068693, increase the time from 500ms to 10000ms. for JDK-8153209, do not sleep when running tests for CONNECT/FINISH_CONNECT, sleep for other test cases.
06-04-2016

[~ggalimbe] Thanks for tracking the issue. 1. The issue reported here in this bug is tracked by JDK-8068693, I think they are duplicated. Could I suggest mark this bug as duplicate of JDK-8068693 and close it? 2. The issue fixed by JDK-8151582 is a different issue, it's a high frequent test issue.
05-04-2016

Another failure in build: http://java.se.oracle.com/mach5/job/9-dev-tier2-windows-i586/1223/testReport/junit/java_nio_channels_AsyncCloseAndInterrupt/java/AsyncCloseAndInterrupt/
04-04-2016

Hamlin, pls investigate the associated changeset, we might still have some error windows.
31-03-2016