RFR: 8366736: Closed System.out causes child process to hang on Windows [v5]

Alan Bateman alanb at openjdk.org
Tue Jan 27 08:05:07 UTC 2026


On Mon, 26 Jan 2026 21:53:59 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> src/java.base/share/classes/java/lang/ProcessBuilder.java line 936:
>> 
>>> 934:      * If {#code System.out} and/or {#code System.err} have been
>>> 935:      * closed in the current process, the corresponding output
>>> 936:      * in the subprocess will be discarded.
>> 
>> Suggestion:
>> 
>>      * When the process is {@link #start started}, 
>>      * if {#code System.out} and/or {#code System.err} have been
>>      * closed in the current process, the corresponding output
>>      * in the subprocess will be discarded.
>> 
>> Qualified to apply at the time the process is started, not when ProcessBuilder.inheritIO is called.
>
> Thank Roger. I updated the text as you suggested and create the CSR: [JDK-8376413](https://bugs.openjdk.org/browse/JDK-8376413)

API notes provide "commentary, rationale, or examples pertaining to the API". They don't strictly require a CSR as they aren't spec.

I think the proposed note is closer to an implNote as it is documenting what the JDK implementation does if the out/error streams are closed. We could potentially consider promoting it to spec, requiring all implementations to discard in this case, maybe you've discussed this already?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29198#discussion_r2730733839


More information about the core-libs-dev mailing list