@@ -163,8 +163,10 @@ protected CountDownLatch pump(Process p, ExecutorRequest executorRequest) {
163163 CountDownLatch latch = new CountDownLatch (3 );
164164 String suffix = "-pump-" + p .pid ();
165165 Thread stdoutPump = new Thread (() -> {
166- try (OutputStream stdout = executorRequest .stdOut ().orElse (OutputStream .nullOutputStream ())) {
166+ try {
167+ OutputStream stdout = executorRequest .stdOut ().orElse (OutputStream .nullOutputStream ());
167168 p .getInputStream ().transferTo (stdout );
169+ stdout .flush ();
168170 } catch (IOException e ) {
169171 throw new UncheckedIOException (e );
170172 } finally {
@@ -174,8 +176,10 @@ protected CountDownLatch pump(Process p, ExecutorRequest executorRequest) {
174176 stdoutPump .setName ("stdout" + suffix );
175177 stdoutPump .start ();
176178 Thread stderrPump = new Thread (() -> {
177- try (OutputStream stderr = executorRequest .stdErr ().orElse (OutputStream .nullOutputStream ())) {
179+ try {
180+ OutputStream stderr = executorRequest .stdErr ().orElse (OutputStream .nullOutputStream ());
178181 p .getErrorStream ().transferTo (stderr );
182+ stderr .flush ();
179183 } catch (IOException e ) {
180184 throw new UncheckedIOException (e );
181185 } finally {
@@ -185,8 +189,10 @@ protected CountDownLatch pump(Process p, ExecutorRequest executorRequest) {
185189 stderrPump .setName ("stderr" + suffix );
186190 stderrPump .start ();
187191 Thread stdinPump = new Thread (() -> {
188- try (OutputStream in = p .getOutputStream ()) {
192+ try {
193+ OutputStream in = p .getOutputStream ();
189194 executorRequest .stdIn ().orElse (InputStream .nullInputStream ()).transferTo (in );
195+ in .flush ();
190196 } catch (IOException e ) {
191197 throw new UncheckedIOException (e );
192198 } finally {
0 commit comments