@@ -241,26 +241,21 @@ private[spark] class Executor(
241241 // Attempt to exit cleanly by informing the driver of our failure.
242242 // If anything goes wrong (or this was a fatal exception), we will delegate to
243243 // the default uncaught exception handler, which will terminate the Executor.
244- try {
245- logError(" Exception in task ID " + taskId, t)
246-
247- val serviceTime = System .currentTimeMillis() - taskStart
248- val metrics = attemptedTask.flatMap(t => t.metrics)
249- for (m <- metrics) {
250- m.executorRunTime = serviceTime
251- m.jvmGCTime = gcTime - startGCTime
252- }
253- val reason = ExceptionFailure (t.getClass.getName, t.toString, t.getStackTrace, metrics)
254- execBackend.statusUpdate(taskId, TaskState .FAILED , ser.serialize(reason))
255-
256- // Don't forcibly exit unless the exception was inherently fatal, to avoid
257- // stopping other tasks unnecessarily.
258- if (Utils .isFatalError(t)) {
259- ExecutorUncaughtExceptionHandler .uncaughtException(t)
260- }
261- } catch {
262- case t2 : Throwable =>
263- ExecutorUncaughtExceptionHandler .uncaughtException(t2)
244+ logError(" Exception in task ID " + taskId, t)
245+
246+ val serviceTime = System .currentTimeMillis() - taskStart
247+ val metrics = attemptedTask.flatMap(t => t.metrics)
248+ for (m <- metrics) {
249+ m.executorRunTime = serviceTime
250+ m.jvmGCTime = gcTime - startGCTime
251+ }
252+ val reason = ExceptionFailure (t.getClass.getName, t.toString, t.getStackTrace, metrics)
253+ execBackend.statusUpdate(taskId, TaskState .FAILED , ser.serialize(reason))
254+
255+ // Don't forcibly exit unless the exception was inherently fatal, to avoid
256+ // stopping other tasks unnecessarily.
257+ if (Utils .isFatalError(t)) {
258+ ExecutorUncaughtExceptionHandler .uncaughtException(t)
264259 }
265260 }
266261 } finally {
0 commit comments