Skip to content

Don't drop "inherit" flag from standard stream handles on Windows - #409

Open
mlopatkin wants to merge 1 commit into
masterfrom
ml/native-397/windows-handle-race
Open

Don't drop "inherit" flag from standard stream handles on Windows#409
mlopatkin wants to merge 1 commit into
masterfrom
ml/native-397/windows-handle-race

Conversation

@mlopatkin

Copy link
Copy Markdown
Member

This was a useful workaround for ancient Java versions that prevented standard streams from unintentionally leaking into unrelated processes started by ProcessBuilder.

As of Java 8 (and final updates of 7), the JDK itself handles that, see https://bugs.openjdk.org/browse/JDK-7147084

The native-platform is Java 8+ today, so the workaround is no longer necessary. Moreover, it is known to cause issues when the standard stream handles go stale, in particular when Gradle daemon closes its System.out and System.err without updating the native side.

This was a useful workaround for ancient Java versions that prevented
standard streams from unintentionally leaking into unrelated processes
started by ProcessBuilder.

As of Java 8 (and final updates of 7), the JDK itself handles that, see
https://bugs.openjdk.org/browse/JDK-7147084

The native-platform is Java 8+ today, so the workaround is no longer
necessary. Moreover, it is known to cause issues when the standard
stream handles go stale, in particular when Gradle daemon closes its
System.out and System.err without updating the native side.
@mlopatkin
mlopatkin requested a review from a team as a code owner August 12, 2026 13:51
@mlopatkin
mlopatkin marked this pull request as draft August 12, 2026 13:52
@mlopatkin
mlopatkin removed the request for review from a team August 12, 2026 13:52
@mlopatkin mlopatkin self-assigned this Aug 12, 2026
@mlopatkin
mlopatkin marked this pull request as ready for review August 12, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WindowsProcessLauncher causes ERROR_ACCESS_DENIED (errno 5) due to race on concurrent spawns

1 participant