From 036eaefeef3751d2dd88a571e96052afe5d23430 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Thu, 15 Nov 2007 02:12:25 +0000 Subject: [PATCH] leak handling was not working. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@5906 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/Proc.java | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/hudson/Proc.java b/core/src/main/java/hudson/Proc.java index 8b12ad31ea..3fc4a153ee 100644 --- a/core/src/main/java/hudson/Proc.java +++ b/core/src/main/java/hudson/Proc.java @@ -1,8 +1,8 @@ package hudson; import hudson.remoting.Channel; -import hudson.util.StreamCopyThread; import hudson.util.IOException2; +import hudson.util.StreamCopyThread; import java.io.File; import java.io.IOException; @@ -123,8 +123,21 @@ public abstract class Proc { String msg = "Process leaked file descriptors. See http://hudson.gotdns.com/wiki/display/HUDSON/Spawning+processes+from+build for more information"; Throwable e = new Exception().fillInStackTrace(); LOGGER.log(Level.WARNING,msg,e); - proc.getInputStream().close(); - proc.getErrorStream().close(); + + // doing proc.getInputStream().close() hangs in FileInputStream.close0() + // it could be either because another thread is blocking on read, or + // it could be a bug in Windows JVM. Who knows. + // so I'm abandoning the idea of closing the stream +// try { +// proc.getInputStream().close(); +// } catch (IOException x) { +// LOGGER.log(Level.FINE,"stdin termination failed",x); +// } +// try { +// proc.getErrorStream().close(); +// } catch (IOException x) { +// LOGGER.log(Level.FINE,"stderr termination failed",x); +// } out.write(msg.getBytes()); out.write('\n'); }