Return-Path: X-Original-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1289418157 for ; Sat, 30 Jan 2016 00:30:41 +0000 (UTC) Received: (qmail 50637 invoked by uid 500); 30 Jan 2016 00:30:40 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 50577 invoked by uid 500); 30 Jan 2016 00:30:40 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-issues@hadoop.apache.org Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 50541 invoked by uid 99); 30 Jan 2016 00:30:40 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 30 Jan 2016 00:30:40 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id DF3F42C1F54 for ; Sat, 30 Jan 2016 00:30:39 +0000 (UTC) Date: Sat, 30 Jan 2016 00:30:39 +0000 (UTC) From: "Sidharta Seethana (JIRA)" To: common-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HADOOP-12748) Uncaught exceptions are not caught/logged when ExecutorService is used MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ 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)