hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sidharta Seethana (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HADOOP-12748) Uncaught exceptions are not caught/logged when ExecutorService is used
Date Sat, 30 Jan 2016 00:30:39 GMT

     [ https://issues.apache.org/jira/browse/HADOOP-12748?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Sidharta Seethana updated HADOOP-12748:
---------------------------------------
    Description: 
{{ThreadPoolExecutor}} catches (otherwise uncaught) exceptions/errors thrown by the tasks
running in the corresponding thread pool. These are passed to an {{afterExecute}} method which
seems to do nothing by default unless overridden.  Even though we register {{UncaughtExceptionHandler}}
s in various places (e.g {{YarnUncaughtExceptionHandler}}), these handlers are not invoked
because the uncaught exceptions/errors are not propagated all the way  

To fix this, 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 

Edit: uploaded some test code that demonstrates this issue. 


  was:
{{ThreadPoolExecutor}} catches (otherwise uncaught) exceptions/errors thrown by the tasks
running in the corresponding thread pool. These are passed to an {{afterExecute}} method which
seems to do nothing by default unless overridden.  Even though we register {{UncaughtExceptionHandler}}
s in various places (e.g {{YarnUncaughtExceptionHandler}}), these handlers are not invoked
because the uncaught exceptions/errors are not propagated all the way. 

To fix this, 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 

Edit: uploaded some test code that demonstrates this issue. 



> Uncaught exceptions are not caught/logged when ExecutorService is used
> ----------------------------------------------------------------------
>
>                 Key: HADOOP-12748
>                 URL: https://issues.apache.org/jira/browse/HADOOP-12748
>             Project: Hadoop Common
>          Issue Type: Bug
>            Reporter: Sidharta Seethana
>            Assignee: Sidharta Seethana
>         Attachments: TestUncaughExceptionHandler.java
>
>
> {{ThreadPoolExecutor}} catches (otherwise uncaught) exceptions/errors thrown by the tasks
running in the corresponding thread pool. These are passed to an {{afterExecute}} method which
seems to do nothing by default unless overridden.  Even though we register {{UncaughtExceptionHandler}}
s in various places (e.g {{YarnUncaughtExceptionHandler}}), these handlers are not invoked
because the uncaught exceptions/errors are not propagated all the way  
> To fix this, 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 
> Edit: uploaded some test code that demonstrates this issue. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message