chukwa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ey...@apache.org
Subject svn commit: r773955 - in /hadoop/chukwa: branches/chukwa-0.1/src/java/org/apache/hadoop/chukwa/inputtools/plugin/ExecPlugin.java trunk/src/java/org/apache/hadoop/chukwa/inputtools/plugin/ExecPlugin.java
Date Tue, 12 May 2009 16:07:47 GMT
Author: eyang
Date: Tue May 12 16:07:46 2009
New Revision: 773955

URL: http://svn.apache.org/viewvc?rev=773955&view=rev
Log:
CHUKWA-229. Fix descriptor leak for ExecPlugin. (Ari Rabkin via Eric Yang)

Modified:
    hadoop/chukwa/branches/chukwa-0.1/src/java/org/apache/hadoop/chukwa/inputtools/plugin/ExecPlugin.java
    hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/inputtools/plugin/ExecPlugin.java

Modified: hadoop/chukwa/branches/chukwa-0.1/src/java/org/apache/hadoop/chukwa/inputtools/plugin/ExecPlugin.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/branches/chukwa-0.1/src/java/org/apache/hadoop/chukwa/inputtools/plugin/ExecPlugin.java?rev=773955&r1=773954&r2=773955&view=diff
==============================================================================
--- hadoop/chukwa/branches/chukwa-0.1/src/java/org/apache/hadoop/chukwa/inputtools/plugin/ExecPlugin.java
(original)
+++ hadoop/chukwa/branches/chukwa-0.1/src/java/org/apache/hadoop/chukwa/inputtools/plugin/ExecPlugin.java
Tue May 12 16:07:46 2009
@@ -25,6 +25,13 @@
 import java.io.InputStreamReader;
 import org.json.JSONObject;
 
+/**
+ * Runs external command-line tools, captures output.
+ * 
+ * Subclasses are responsible for implementing getCmde(), which determines the
+ * command to be invoked.
+ * 
+ */
 public abstract class ExecPlugin implements IPlugin {
   public final int statusOK = 100;
   public final int statusKO = -100;
@@ -66,6 +73,7 @@
       int exitValue = process.waitFor();
       stdOut.join();
       stdErr.join();
+      process.getInputStream().close(); //otherwise this implicitly stays open
       result.put("exitValue", exitValue);
       result.put("stdout", stdOut.output.toString());
       result.put("stderr", stdErr.output.toString());

Modified: hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/inputtools/plugin/ExecPlugin.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/inputtools/plugin/ExecPlugin.java?rev=773955&r1=773954&r2=773955&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/inputtools/plugin/ExecPlugin.java
(original)
+++ hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/inputtools/plugin/ExecPlugin.java
Tue May 12 16:07:46 2009
@@ -25,6 +25,13 @@
 import java.io.InputStreamReader;
 import org.json.JSONObject;
 
+/**
+ * Runs external command-line tools, captures output.
+ * 
+ * Subclasses are responsible for implementing getCmde(), which determines the
+ * command to be invoked.
+ * 
+ */
 public abstract class ExecPlugin implements IPlugin {
   public final int statusOK = 100;
   public final int statusKO = -100;
@@ -66,6 +73,7 @@
       int exitValue = process.waitFor();
       stdOut.join();
       stdErr.join();
+      process.getInputStream().close(); //otherwise this implicitly stays open
       result.put("exitValue", exitValue);
       result.put("stdout", stdOut.output.toString());
       result.put("stderr", stdErr.output.toString());



Mime
View raw message