Browse Source

HADOOP-11172. Improve error message in Shell#runCommand on OutOfMemoryError. (Yongjun Zhang via wang)

(cherry picked from commit 4b2834898cbcc66ffbf01b2fb10375e79a50d538)
Andrew Wang 10 years ago
parent
commit
52c8ac90ea

+ 3 - 0
hadoop-common-project/hadoop-common/CHANGES.txt

@@ -14,6 +14,9 @@ Release 2.7.0 - UNRELEASED
     HDFS-7186. Document the "hadoop trace" command. (Masatake Iwasaki via Colin
     P. McCabe)
 
+    Improve error message in Shell#runCommand on OutOfMemoryError.
+    (Yongjun Zhang via wang)
+
   OPTIMIZATIONS
 
   BUG FIXES

+ 7 - 1
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Shell.java

@@ -519,7 +519,13 @@ abstract public class Shell {
     };
     try {
       errThread.start();
-    } catch (IllegalStateException ise) { }
+    } catch (IllegalStateException ise) {
+    } catch (OutOfMemoryError oe) {
+      LOG.error("Caught " + oe + ". One possible reason is that ulimit"
+          + " setting of 'max user processes' is too low. If so, do"
+          + " 'ulimit -u <largerNum>' and try again.");
+      throw oe;
+    }
     try {
       parseExecResult(inReader); // parse the output
       // clear the input stream buffer