hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1384435 - in /hadoop/common/trunk/hadoop-common-project/hadoop-common: CHANGES.txt src/main/java/org/apache/hadoop/util/ExitUtil.java
Date Thu, 13 Sep 2012 17:56:50 GMT
Author: eli
Date: Thu Sep 13 17:56:49 2012
New Revision: 1384435

URL: http://svn.apache.org/viewvc?rev=1384435&view=rev
Log:
HADOOP-8801. ExitUtil#terminate should capture the exception stack trace. Contributed by Eli
Collins

Modified:
    hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
    hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ExitUtil.java

Modified: hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt?rev=1384435&r1=1384434&r2=1384435&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt (original)
+++ hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt Thu Sep 13 17:56:49
2012
@@ -355,6 +355,8 @@ Release 2.0.2-alpha - 2012-09-07 
     HADOOP-8754. Deprecate all the RPC.getServer() variants.  (Brandon Li
     via szetszwo)
 
+    HADOOP-8801. ExitUtil#terminate should capture the exception stack trace. (eli)
+
   BUG FIXES
 
     HADOOP-8372. NetUtils.normalizeHostName() incorrectly handles hostname

Modified: hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ExitUtil.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ExitUtil.java?rev=1384435&r1=1384434&r2=1384435&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ExitUtil.java
(original)
+++ hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ExitUtil.java
Thu Sep 13 17:56:49 2012
@@ -17,6 +17,9 @@
  */
 package org.apache.hadoop.util;
 
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.classification.InterfaceAudience;
@@ -101,7 +104,10 @@ public final class ExitUtil {
    * @throws ExitException if System.exit is disabled for test purposes
    */
   public static void terminate(int status, Throwable t) throws ExitException {
-    terminate(status, t.getMessage());
+    StringWriter sw = new StringWriter();
+    t.printStackTrace(new PrintWriter(sw));
+    terminate(status, "Fatal exception with message " + t.getMessage() +
+        "\nstack trace\n" + sw.toString());
   }
 
   /**



Mime
View raw message