-
Bug
-
Resolution: Fixed
-
P4
-
8, 11, 17
-
b01
-
generic
-
linux
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8319183 | 11.0.22 | Paul Hohensee | P4 | Resolved | Fixed | b01 |
The issue was originally reported at https://github.com/async-profiler/async-profiler/issues/769
When the wall clock profiler is enabled, `Socket.connect(address, timeout)` does not return after timeout elapses. This happens, because the poll() syscall is repeatedly restarted due to EINTR, but the timeout argument is not adjusted.
I have reproduced the bug in pure Java without a profiler, see attached SocketTimeoutBug.java
The issue happens on JDK 8 and JDK 11. JDK 13 switched the JDK to a new SocketImpl that doesn't have this issue. The old SocketImpl is still present in JDK 17 so it can be duplicated when running with -Djdk.net.usePlainSocketImpl.
When the wall clock profiler is enabled, `Socket.connect(address, timeout)` does not return after timeout elapses. This happens, because the poll() syscall is repeatedly restarted due to EINTR, but the timeout argument is not adjusted.
I have reproduced the bug in pure Java without a profiler, see attached SocketTimeoutBug.java
The issue happens on JDK 8 and JDK 11. JDK 13 switched the JDK to a new SocketImpl that doesn't have this issue. The old SocketImpl is still present in JDK 17 so it can be duplicated when running with -Djdk.net.usePlainSocketImpl.