[jdk17u-dev] RFR: 8312065: Socket.connect does not timeout as expected when profiling
Long Yang
duke at openjdk.org
Fri Aug 4 03:08:04 UTC 2023
Hi all,
This pull request contains a fix for [JDK-8312065](https://bugs.openjdk.org/browse/JDK-8312065).
The old SocketImpl is still present in JDK 17, can be enabled with -Djdk.net.usePlainSocketImpl.
I have verified that this problem exists on Linux and macOS, and I feel that it also exists on AIX,
so I repaired these 3 platforms. Windows implementations are different, so don't have this problem.
I added a platform dependent test.
The test needs to get the OS thread ID of the Java thread. It seems that there is no good Java API to get it directly. The minimum requirement of Linux [/proc/thread-self](https://man7.org/linux/man-pages/man5/proc.5.html#:~:text=/proc/thread%2Dself%20(since%20Linux%203.17)) is Linux 3.17.
The JFR event records the OS thread ID, although this method is cumbersome, it is reliable.
The test also needs to use the kill command to send a signal to the thread. macOS's kill seems to only support process, and I don't have an AIX environment, so this test only supports Linux.
Thanks!
-------------
Commit messages:
- 8312065: Socket.connect does not timeout as expected when profiling
Changes: https://git.openjdk.org/jdk17u-dev/pull/1639/files
Webrev: https://webrevs.openjdk.org/?repo=jdk17u-dev&pr=1639&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8312065
Stats: 282 lines in 4 files changed: 279 ins; 0 del; 3 mod
Patch: https://git.openjdk.org/jdk17u-dev/pull/1639.diff
Fetch: git fetch https://git.openjdk.org/jdk17u-dev.git pull/1639/head:pull/1639
PR: https://git.openjdk.org/jdk17u-dev/pull/1639
More information about the jdk-updates-dev
mailing list