@@ -55,12 +55,10 @@ public void close() throws IOException {
5555 /**
5656 * Spawns the native controllers for each module.
5757 *
58- * @param environment The node environment
59- * @param inheritIo Should the stdout and stderr of the spawned process inherit the
60- * stdout and stderr of the JVM spawning it?
58+ * @param environment the node environment
6159 * @throws IOException if an I/O error occurs reading the module or spawning a native process
6260 */
63- void spawnNativeControllers (final Environment environment , final boolean inheritIo ) throws IOException {
61+ void spawnNativeControllers (final Environment environment ) throws IOException {
6462 if (!spawned .compareAndSet (false , true )) {
6563 throw new IllegalStateException ("native controllers already spawned" );
6664 }
@@ -85,7 +83,7 @@ void spawnNativeControllers(final Environment environment, final boolean inherit
8583 modules .getFileName ());
8684 throw new IllegalArgumentException (message );
8785 }
88- final Process process = spawnNativeController (spawnPath , environment .tmpFile (), inheritIo );
86+ final Process process = spawnNativeController (spawnPath , environment .tmpFile ());
8987 processes .add (process );
9088 }
9189 }
@@ -94,7 +92,7 @@ void spawnNativeControllers(final Environment environment, final boolean inherit
9492 * Attempt to spawn the controller daemon for a given module. The spawned process will remain connected to this JVM via its stdin,
9593 * stdout, and stderr streams, but the references to these streams are not available to code outside this package.
9694 */
97- private Process spawnNativeController (final Path spawnPath , final Path tmpPath , final boolean inheritIo ) throws IOException {
95+ private Process spawnNativeController (final Path spawnPath , final Path tmpPath ) throws IOException {
9896 final String command ;
9997 if (Constants .WINDOWS ) {
10098 /*
@@ -116,14 +114,6 @@ private Process spawnNativeController(final Path spawnPath, final Path tmpPath,
116114 pb .environment ().clear ();
117115 pb .environment ().put ("TMPDIR" , tmpPath .toString ());
118116
119- // The process _shouldn't_ write any output via its stdout or stderr, but if it does then
120- // it will block if nothing is reading that output. To avoid this we can inherit the
121- // JVM's stdout and stderr (which are redirected to files in standard installations).
122- if (inheritIo ) {
123- pb .redirectOutput (ProcessBuilder .Redirect .INHERIT );
124- pb .redirectError (ProcessBuilder .Redirect .INHERIT );
125- }
126-
127117 // the output stream of the process object corresponds to the daemon's stdin
128118 return pb .start ();
129119 }
0 commit comments