[FIXED HUDSON-8244] turns out Process.getErrorStream() needs to be explicitly closed even when stderr is redirected to stdout.

This commit is contained in:
Kohsuke Kawaguchi committed 2010-12-10 23:50:17 -08:00
1 parent ed1c36911c
commit d1543575e2
2 files changed
+7

No files matched your search

+4
View File
@@ -200,6 +200,10 @@ public abstract class Proc {
copier2 = new StreamCopyThread(name+": stderr copier", proc.getErrorStream(), err);
copier2.start();
} else {
// while this is not discussed in javadoc, even with ProcessBuilder.redirectErrorStream(true),
// Process.getErrorStream() still returns a distinct reader end of a pipe that needs to be closed.
// this is according to the source code of JVM
proc.getErrorStream().close();
copier2 = null;
}
}