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

Roger Riggs rriggs at openjdk.org
Mon Feb 2 14:46:37 UTC 2026


On Sat, 31 Jan 2026 04:40:13 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.
>
> SendaoYan has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Revert the change of lsof -p and only increase timeout value for test
>  - Revert "8376630: java/lang/ProcessBuilder/PipelineLeaksFD.java intermittent timed out"
>    
>    This reverts commit 23d6dd1ae20bdd8957826f443a95bd4e69000eab.

test/jdk/java/lang/ProcessBuilder/PipelineLeaksFD.java line 243:

> 241:                 .start()) {
> 242:             boolean status = p.waitFor(Utils.adjustTimeout(120), TimeUnit.SECONDS);
> 243:             if (!status) {

Retry on destroyForcibly isn't necessary or productive. On Linux its equivalent to 'kill -9' and on Windows it isn't conditional.
If there is a case where the a single call isn't effective, that should be reported as a bug against `destroyForcibly`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29478#discussion_r2754697692


More information about the core-libs-dev mailing list