RFR: 8376630: java/lang/ProcessBuilder/PipelineLeaksFD.java intermittent timed out

Roger Riggs rriggs at openjdk.org
Thu Jan 29 14:44:08 UTC 2026


On Thu, 29 Jan 2026 02:35:23 GMT, SendaoYan <syan at openjdk.org> wrote:

> Hi all,
> 
> Test java/lang/ProcessBuilder/PipelineLeaksFD.java intermittent timed out, because `lsof` invoke huast lots of time when the tested machine has many processes, and the processes open too many files.
> 
> This PR add parameter -p pid to `lsof`, which will only generate output from the wanted processes, rather than all the processes on the machine, this will make `lsof` use less time to finish significantly. And this PR also use `Process.waitFor(long timeout, TimeUnit unit)` instead of `waitFor()` which will avoid waitFor invoke cause test timed out. Delete the history lsof input and output files will make diagnosis more easy.
> 
> Change has been verifed locally. The imtermittent timed out do not observed anymore.

The previous version used /proc to determine file descriptors, but lsof was available on all platforms and common code was desirable (though the output format is different).
It might make more sense to go back to the /proc/self/fds on Linux.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/29478#issuecomment-3818109815


More information about the core-libs-dev mailing list