JDK 17 | JDK 21 | JDK 23 |
---|---|---|
17.0.13Fixed | 21.0.5-oracleFixed | 23 b09Fixed |
Blocks :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
After the fix for JDK-8300088 some JDI/JDWP tests started exhibiting timeouts. [~jpai] reports: The root cause is this code in jdwp which does the work of launching a process (passed as a command to launch=cmdline option) https://github.com/openjdk/jdk/blob/master/src/jdk.jdwp.agent/unix/native/libjdwp/exec_md.c#L103. it forks the child process and then goes ahead to close all possible file descriptor copies (from its parent) of this newly created child process. to do that it fetches the max number of allowed open descriptors (sysconf) and then iterates over it one by one (starting fd=3) to close them all. before the change in JDK-8300088, the max_fd value in that loop used to be relatively smaller 10240 and it appears that it was able to close them all in a reasonable amount of time. however, now the value returned there for max_fd is 2147483647 and by the time the test times out, that loop has only been able to close around 26839415 odd file descriptors and is still continuing to close the rest I had a quick look at how we handle forking in other APIs in the JDK and turns out there is a more optimal way we do it in the Process impl native code https://github.com/openjdk/jdk/blob/master/src/java.base/unix/native/libjava/childproc.c#L74
|