Repository: spark
Updated Branches:
  refs/heads/master 8cd1692c9 -> e747e9849


[SPARK-6058][Yarn] Log the user class exception in ApplicationMaster

Because ApplicationMaster doesn't set SparkUncaughtExceptionHandler, the 
exception in the user class won't be logged. This PR added a `logError` for it.

Author: zsxwing <zsxw...@gmail.com>

Closes #4813 from zsxwing/SPARK-6058 and squashes the following commits:

806c932 [zsxwing] Log the user class exception


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/e747e984
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/e747e984
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/e747e984

Branch: refs/heads/master
Commit: e747e98490f8ede23b0a9e0795e7445d0b597624
Parents: 8cd1692
Author: zsxwing <zsxw...@gmail.com>
Authored: Fri Feb 27 13:31:46 2015 +0000
Committer: Sean Owen <so...@cloudera.com>
Committed: Fri Feb 27 13:31:46 2015 +0000

----------------------------------------------------------------------
 .../scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala    | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/e747e984/yarn/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala
----------------------------------------------------------------------
diff --git 
a/yarn/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala 
b/yarn/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala
index 20fc191..796422b 100644
--- a/yarn/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala
+++ b/yarn/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala
@@ -486,11 +486,10 @@ private[spark] class ApplicationMaster(
               case _: InterruptedException =>
                 // Reporter thread can interrupt to stop user class
               case cause: Throwable =>
+                logError("User class threw exception: " + cause.getMessage, 
cause)
                 finish(FinalApplicationStatus.FAILED,
                   ApplicationMaster.EXIT_EXCEPTION_USER_CLASS,
                   "User class threw exception: " + cause.getMessage)
-                // re-throw to get it logged
-                throw cause
             }
         }
       }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to