Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
-
None
Description
When tasks running in a ThreadPoolExecutor throw an error/exception that is otherwise uncaught, it might not be propagated to the thread's uncaught exception handler because enclosing tasks (e.g FutureTask) might capture these exceptions (and do nothing). For more details, see : https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ThreadPoolExecutor.html#afterExecute-java.lang.Runnable-java.lang.Throwable-
To ensure such errors are logged, one mechanism would be to override ThreadPoolExecutor with an afterExecute method that would log these exceptions/errors. Logging these exceptions/errors would be useful in debugging issues that are otherwise difficult to trace (e.g YARN-4643) because there is nothing in the logs indicating an uncaught exception/error
Some test code that demonstrates this issue is attached.