提交 d1543575 编写于 作者: K Kohsuke Kawaguchi

[FIXED HUDSON-8244] turns out Process.getErrorStream() needs to be explicitly...

[FIXED HUDSON-8244] turns out Process.getErrorStream() needs to be explicitly closed even when stderr is redirected to stdout.
上级 ed1c3691
......@@ -43,6 +43,9 @@ Upcoming changes</a>
<li class=bug>
" (from WhateverTest)" gratuitously appended to test result detail pages.
(<a href="http://issues.hudson-ci.org/browse/HUDSON-5655">issue 5655</a>)
<li class=bug>
Fixed a pipe leak to child processes.
(<a href="http://issues.hudson-ci.org/browse/HUDSON-8244">issue 8244</a>)
<li class=rfe>
Debian package init script now honors <tt>~/.profile</tt>.
<li class=rfe>
......
......@@ -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;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册