RFR: 8291986: ProcessBuilder.redirectErrorStream(true) leaves error stream available [v4]

Jaikiran Pai jpai at openjdk.org
Thu Jan 15 15:08:09 UTC 2026


On Thu, 15 Jan 2026 13:19:46 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>> On Linux and Mac, when a process is started, pipes are created to communicate with the child.
>> In the case where the stderr is redirected to stdout using `ProcessBuilder.redirectErrorStream()`, the pipe is not needed and should not be created.
>> 
>> Added a test to check pipe creation when spawning with and without `redirectErrorStream(t/f)`. 
>> Rewrote the extraction of pipes to use `lsof` available on Mac and Linux. (previously used Linux /proc/pid/fd/...)
>> Converted PipelineLeaksFD test to JUnit.
>
> Roger Riggs has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Refactor execution of lsof to provide more debugging information.
>   The raw lsof output is retained and printed to the log on a failure.
>   A couple of intermittent failures have reported too many or too few pipes.
>   Additional lsof information can help identify the extra pipes.

The test update looks reasonable to me.

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

Marked as reviewed by jpai (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/29143#pullrequestreview-3666075225


More information about the core-libs-dev mailing list