JDK-8136899 : (ch) java/nio/channels/etc/AdaptorCloseAndInterrupt.java fails intermittently due to SocketTimeoutException
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.nio
  • Affected Version: 9,10
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: linux
  • CPU: x86_64
  • Submitted: 2015-09-22
  • Updated: 2023-10-02
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.
Other
tbdUnresolved
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
java/nio/channels/etc/AdaptorCloseAndInterrupt.java fails intermittently

----------System.err:(15/882)----------
java.net.SocketTimeoutException
	at sun.nio.ch.DatagramSocketAdaptor.receive(DatagramSocketAdaptor.java:198)
	at sun.nio.ch.DatagramSocketAdaptor.receive(DatagramSocketAdaptor.java:216)
	at AdaptorCloseAndInterrupt.dcReceiveAsyncInterrupt(AdaptorCloseAndInterrupt.java:159)
	at AdaptorCloseAndInterrupt.main(AdaptorCloseAndInterrupt.java:78)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:519)
	at com.sun.javatest.regtest.agent.MainActionHelper$SameVMRunnable.run(MainActionHelper.java:218)
	at java.lang.Thread.run(Thread.java:746)

JavaTest Message: Test threw exception: java.net.SocketTimeoutException
JavaTest Message: shutting down test

result: Failed. Execution failed: `main' threw exception: java.net.SocketTimeoutException
Comments
This test has been observed to fail in four different ways which are listed below. These results are compiled from the .jtr files listed in the comments above and in the comments of the related issue JDK-8136899. The first failure, "java.lang.RuntimeException: read should not have completed," has been logged in both this issue (which covers #3: SocketTimeoutException) and in JDK-8136899 (which covers #2: ClosedByInterruptException) although it is actually a different problem from either of these. The fourth failure (#4: IOException: Bad file descriptor) appears to have been observed only once and could very likely be a test system issue. The SocketTimeoutException appears to be Linux-specific, but the ClosedByInterruptException and the RuntimeException were observed on the 64-bit versions of Linux, Solaris, and Windows. 1) Line 99: RuntimeException java.lang.RuntimeException: read should not have completed at AdaptorCloseAndInterrupt.scReadAsyncClose(AdaptorCloseAndInterrupt.java:99) at AdaptorCloseAndInterrupt.main(AdaptorCloseAndInterrupt.java:71) Observations: 2016-09-08 b133 solaris-64 2016-12-16 b149 windows-64 2016-12-16 b151 solaris-64 2017-02-13 b159 linux-64 2) Line 129: ClosedByInterruptException (tracked separately by JDK-8150811) java.nio.channels.ClosedByInterruptException at java.nio.channels.spi.AbstractInterruptibleChannel.end(AbstractInterruptibleChannel.java:199) at sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:257) at AdaptorCloseAndInterrupt.scReadAsyncInterrupt(AdaptorCloseAndInterrupt.java:129) at AdaptorCloseAndInterrupt.main(AdaptorCloseAndInterrupt.java:72) Observations: 2016-01-17 b88 solaris-64 b100 solaris-64 2016-03-14 Mach 5 1129 windows-64 2016-03-17 b109 linux-64 2016-07-26 b109 linux-64 2016-12-12 b147 solaris-64 3) Line 159: SocketTimeoutException java.net.SocketTimeoutException at sun.nio.ch.DatagramSocketAdaptor.receive(DatagramSocketAdaptor.java:198) at sun.nio.ch.DatagramSocketAdaptor.receive(DatagramSocketAdaptor.java:216) at AdaptorCloseAndInterrupt.dcReceiveAsyncInterrupt(AdaptorCloseAndInterrupt.java:159) at AdaptorCloseAndInterrupt.main(AdaptorCloseAndInterrupt.java:78) Observations: 2015-09-22 b81 linux-64 2016-01-17 b95 linux-64 2016-11-18 b143 linux-64 2017-02-13 b155 linux-64 4) Line 177: IOException java.io.IOException: Bad file descriptor at sun.nio.ch.IOUtil.configureBlocking(java.base@9-ea/Native Method) at sun.nio.ch.ServerSocketChannelImpl.implConfigureBlocking(java.base@9-ea/ServerSocketChannelImpl.java:285) at java.nio.channels.spi.AbstractSelectableChannel.configureBlocking(java.base@9-ea/AbstractSelectableChannel.java:294) at sun.nio.ch.ServerSocketAdaptor.accept(java.base@9-ea/ServerSocketAdaptor.java:106) at AdaptorCloseAndInterrupt.ssAcceptAsyncClose(AdaptorCloseAndInterrupt.java:177) at AdaptorCloseAndInterrupt.main(AdaptorCloseAndInterrupt.java:81) Observations: 2016-07-08 b125 linux-64
30-03-2017

All the elapsed time is almost same [ elapsed time (seconds): 31.xxx, 32.xxx ], seems the root cause is Thread.interrupt() does not work.
11-04-2016

There 2 types of timeout failures above: 1. one is Thread.interrupt() does not work as expected so socket timeout happens, this one happens on windows/linux. 2. another is listener.accept() timeout which might be due to some kind of deadlock ( as the top stack frame is AbstractInterruptibleChannel.end(...) which might be blocked on something). so file new bug JDK-8150811 to track second kind of failures.
29-02-2016