hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r555371 - in /lucene/hadoop/trunk: CHANGES.txt src/contrib/streaming/src/java/org/apache/hadoop/streaming/PipeMapRed.java src/contrib/streaming/src/java/org/apache/hadoop/streaming/PipeReducer.java
Date Wed, 11 Jul 2007 19:13:57 GMT
Author: cutting
Date: Wed Jul 11 12:13:52 2007
New Revision: 555371

URL: http://svn.apache.org/viewvc?view=rev&rev=555371
Log:
HADOOP-1580.  Improve contrib/streaming so that subprocess exit status is shown for errors.
 Contributed by John Heidemann.

Modified:
    lucene/hadoop/trunk/CHANGES.txt
    lucene/hadoop/trunk/src/contrib/streaming/src/java/org/apache/hadoop/streaming/PipeMapRed.java
    lucene/hadoop/trunk/src/contrib/streaming/src/java/org/apache/hadoop/streaming/PipeReducer.java

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?view=diff&rev=555371&r1=555370&r2=555371
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Wed Jul 11 12:13:52 2007
@@ -293,6 +293,9 @@
      permits coordinated upgrade of datanode data.
      (Konstantin Shvachko via cutting)
 
+ 91. HADOOP-1580.  Improve contrib/streaming so that subprocess exit
+     status is displayed for errors.  (John Heidemann via cutting)
+
 
 Release 0.13.0 - 2007-06-08
 

Modified: lucene/hadoop/trunk/src/contrib/streaming/src/java/org/apache/hadoop/streaming/PipeMapRed.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/contrib/streaming/src/java/org/apache/hadoop/streaming/PipeMapRed.java?view=diff&rev=555371&r1=555370&r2=555371
==============================================================================
--- lucene/hadoop/trunk/src/contrib/streaming/src/java/org/apache/hadoop/streaming/PipeMapRed.java
(original)
+++ lucene/hadoop/trunk/src/contrib/streaming/src/java/org/apache/hadoop/streaming/PipeMapRed.java
Wed Jul 11 12:13:52 2007
@@ -286,7 +286,11 @@
 
   void waitOutputThreads() {
     try {
-      sim.waitFor();
+      int exitVal = sim.waitFor();
+      // how'd it go?
+      if (exitVal != 0) {
+	  logprintln("PipeMapRed.waitOutputThreads(): subprocess failed with code " + exitVal +
" in " + PipeMapRed.class.getName());
+      };
       if (outThread_ != null) {
         outThread_.join(joinDelay_);
       }

Modified: lucene/hadoop/trunk/src/contrib/streaming/src/java/org/apache/hadoop/streaming/PipeReducer.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/contrib/streaming/src/java/org/apache/hadoop/streaming/PipeReducer.java?view=diff&rev=555371&r1=555370&r2=555371
==============================================================================
--- lucene/hadoop/trunk/src/contrib/streaming/src/java/org/apache/hadoop/streaming/PipeReducer.java
(original)
+++ lucene/hadoop/trunk/src/contrib/streaming/src/java/org/apache/hadoop/streaming/PipeReducer.java
Wed Jul 11 12:13:52 2007
@@ -86,9 +86,23 @@
         }
       }
     } catch (IOException io) {
+      // a common reason to get here is failure of the subprocess.
+      // Document that fact, if possible.
+      String extraInfo = "";
+      try {
+        int exitVal = sim.exitValue();
+	if (exitVal == 0) {
+	  extraInfo = "subprocess exited successfully\n";
+	} else {
+	  extraInfo = "subprocess exited with error code " + exitVal + "\n";
+	};
+      } catch (IllegalThreadStateException e) {
+        // hmm, but child is still running.  go figure.
+	extraInfo = "subprocess still running\n";
+      };
       appendLogToJobLog("failure");
       mapRedFinished();
-      throw new IOException(getContext() + io.getMessage());
+      throw new IOException(extraInfo + getContext() + io.getMessage());
     }
   }
 



Mime
View raw message