Ngone51 commented on PR #37779:
URL: https://github.com/apache/spark/pull/37779#issuecomment-1258953985
> Essentially, since we are leveraging a ThreadPoolExecutor, it does not
result in killing the thread with the exception/error thrown - but rather, will
call ThreadPoolExecutor.afterExecute with the cause for failure (See runWorker
for more).
@mridulm Thanks for your analysis. But I still don't get why
`SparkUncaughtExceptionHandler` doesn't catch the throwable.
```java
try {
beforeExecute(wt, task);
Throwable thrown = null;
try {
task.run();
} catch (RuntimeException x) {
thrown = x; throw x;
} catch (Error x) {
thrown = x; throw x;
} catch (Throwable x) {
thrown = x; throw new Error(x);
} finally {
afterExecute(task, thrown);
}
} finally {
task = null;
w.completedTasks++;
w.unlock();
}
```
`afterExecute` does handle the throwable but it doesn't catch it. So the
throwable should be still thrown out.
--
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]