Return-Path: Delivered-To: apmail-hadoop-core-dev-archive@www.apache.org Received: (qmail 45365 invoked from network); 7 Jul 2008 13:40:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Jul 2008 13:40:24 -0000 Received: (qmail 27767 invoked by uid 500); 7 Jul 2008 13:40:23 -0000 Delivered-To: apmail-hadoop-core-dev-archive@hadoop.apache.org Received: (qmail 27757 invoked by uid 500); 7 Jul 2008 13:40:23 -0000 Mailing-List: contact core-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: core-dev@hadoop.apache.org Delivered-To: mailing list core-dev@hadoop.apache.org Received: (qmail 27746 invoked by uid 99); 7 Jul 2008 13:40:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Jul 2008 06:40:23 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Jul 2008 13:39:39 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 9EC02234C155 for ; Mon, 7 Jul 2008 06:39:31 -0700 (PDT) Message-ID: <795620222.1215437971640.JavaMail.jira@brutus> Date: Mon, 7 Jul 2008 06:39:31 -0700 (PDT) From: "Steve Loughran (JIRA)" To: core-dev@hadoop.apache.org Subject: [jira] Updated: (HADOOP-3415) JobEndNotifier isnt synchronized, doesnt check state before acting In-Reply-To: <1433991052.1211202715577.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HADOOP-3415?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Steve Loughran updated HADOOP-3415: ----------------------------------- Attachment: hadoop-3415.patch simple patch to fix a basic problem: the fact that a thread ref may be null during shutdown. > JobEndNotifier isnt synchronized, doesnt check state before acting > ------------------------------------------------------------------ > > Key: HADOOP-3415 > URL: https://issues.apache.org/jira/browse/HADOOP-3415 > Project: Hadoop Core > Issue Type: Bug > Components: mapred > Affects Versions: 0.19.0 > Reporter: Steve Loughran > Priority: Minor > Attachments: hadoop-3415.patch > > > JobEndNotifier is pretty hazardous inside. > 1. the static startNotifier isnt synchronized, and doesnt check for being already running before it creates a new worker thread. It should be sycnhronized and a no-op if there is a live thread. > 2. stopNotifier() should be a no-op if already stopped. It MUST NOT call thread.interrupt() in such a state, as thread may be null. > 3. the registerNotification method also assumes that the static queue is non null. > Things would be a lot safer by making this class part of a JobTracker, not a singleton with static methods, as then you could more safely make assumptions about object state. This would not only eliminate a lot of reentrancy problems, but tie the life of the notifier to that of its owner, the JobTracker. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.