Ngone51 commented on code in PR #52792:
URL: https://github.com/apache/spark/pull/52792#discussion_r2508713879


##########
core/src/main/scala/org/apache/spark/executor/Executor.scala:
##########
@@ -381,7 +381,28 @@ private[spark] class Executor(
       tr.kill(killMark._1, killMark._2)
       killMarks.remove(taskId)
     }
-    threadPool.execute(tr)
+    try {
+      threadPool.execute(tr)
+    } catch {
+      case t: Throwable =>
+        try {
+          logError(log"Executor launch task ${MDC(TASK_NAME, 
taskDescription.name)} failed," +
+            log" reason: ${MDC(REASON, t.getCause)}")

Review Comment:
   `getCause` could return null? Is there a way to print full stacks of the 
error?



##########
core/src/main/scala/org/apache/spark/executor/Executor.scala:
##########
@@ -381,7 +381,28 @@ private[spark] class Executor(
       tr.kill(killMark._1, killMark._2)
       killMarks.remove(taskId)
     }
-    threadPool.execute(tr)
+    try {
+      threadPool.execute(tr)
+    } catch {
+      case t: Throwable =>
+        try {
+          logError(log"Executor launch task ${MDC(TASK_NAME, 
taskDescription.name)} failed," +
+            log" reason: ${MDC(REASON, t.getCause)}")
+          context.statusUpdate(
+            taskDescription.taskId,
+            TaskState.FAILED,
+            env.closureSerializer.newInstance().serialize(new 
ExceptionFailure(t, Seq.empty)))
+        } catch {
+          case oom: OutOfMemoryError =>
+            logError(log"Executor update launching task ${MDC(TASK_NAME, 
taskDescription.name)} " +
+              log"failed status failed, reason: ${MDC(REASON, oom)}")
+            System.exit(SparkExitCode.OOM)
+          case t: Throwable =>
+            logError(log"Executor update launching task ${MDC(TASK_NAME, 
taskDescription.name)} " +
+              log"failed status failed, reason: ${MDC(REASON, t.getCause)}")

Review Comment:
   ditto.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to