Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7178766

Executor Service exceptions propagate to uncaught exception handler

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: 7
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:

      Description

      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 ----------

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                martin Martin Buchholz
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: