mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-10 02:26:18 +00:00
[FIXED HUDSON-8244] turns out Process.getErrorStream() needs to be explicitly closed even when stderr is redirected to stdout.
This commit is contained in:
1 parent
ed1c36911c
commit
d1543575e2
2 files changed
+7
No files matched your search
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user