-
Enhancement
-
Resolution: Not an Issue
-
P4
-
None
-
7
-
x86
-
windows_xp
A DESCRIPTION OF THE REQUEST :
This RFE should be read in conjunction with bug http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7176957
The issue is that exceptions thrown by runnable submitted to an executor service using the submit method instead of the execute method are set on the returned future, and are not passed to any uncaughtExceptionHandler that could be configured via the executorServices's thread-factory. If the returned future is not assigned/inspected, the exception could be lost... it has therefore not been handled by user code, or by the uncaughtExcetionHandler. The javaDoc enhancement described by http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7176957 should warn about this issue, but the resultant futureTask could also pass the exception to the uncaught exception handler in its finalize() method if the exception has not already been raised as an ExecutionException.
JUSTIFICATION :
This enhancement is necessary as lost diagnostic stack-traces can result in simple issues taking a long time to diagnose/fix.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Uncaught exceptions should be passed to uncaughtExceptionHandler
ACTUAL -
exception set on the future and then lost.
---------- BEGIN SOURCE ----------
See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7176957
---------- END SOURCE ----------
This RFE should be read in conjunction with bug http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7176957
The issue is that exceptions thrown by runnable submitted to an executor service using the submit method instead of the execute method are set on the returned future, and are not passed to any uncaughtExceptionHandler that could be configured via the executorServices's thread-factory. If the returned future is not assigned/inspected, the exception could be lost... it has therefore not been handled by user code, or by the uncaughtExcetionHandler. The javaDoc enhancement described by http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7176957 should warn about this issue, but the resultant futureTask could also pass the exception to the uncaught exception handler in its finalize() method if the exception has not already been raised as an ExecutionException.
JUSTIFICATION :
This enhancement is necessary as lost diagnostic stack-traces can result in simple issues taking a long time to diagnose/fix.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Uncaught exceptions should be passed to uncaughtExceptionHandler
ACTUAL -
exception set on the future and then lost.
---------- BEGIN SOURCE ----------
See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7176957
---------- END SOURCE ----------
- relates to
-
JDK-8224858 ThreadPoolExecutor/Callable silently ignores all uncaught exception
-
- Closed
-
-
JDK-7176957 ExecutorService submit method javaDoc enhancement
-
- Open
-