Return-Path: Delivered-To: apmail-hadoop-core-dev-archive@www.apache.org Received: (qmail 3143 invoked from network); 25 Mar 2008 03:07:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Mar 2008 03:07:25 -0000 Received: (qmail 80499 invoked by uid 500); 25 Mar 2008 03:06:35 -0000 Delivered-To: apmail-hadoop-core-dev-archive@hadoop.apache.org Received: (qmail 80478 invoked by uid 500); 25 Mar 2008 03:06:35 -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 80419 invoked by uid 99); 25 Mar 2008 03:06:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Mar 2008 20:06:35 -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; Tue, 25 Mar 2008 03:05:52 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id E4965234C14D for ; Mon, 24 Mar 2008 20:03:26 -0700 (PDT) Message-ID: <351977425.1206414206935.JavaMail.jira@brutus> Date: Mon, 24 Mar 2008 20:03:26 -0700 (PDT) From: "Robert Chansler (JIRA)" To: core-dev@hadoop.apache.org Subject: [jira] Updated: (HADOOP-2062) Standardize long-running, daemon-like, threads in hadoop daemons 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-2062?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Robert Chansler updated HADOOP-2062: ------------------------------------ Fix Version/s: (was: 0.17.0) > Standardize long-running, daemon-like, threads in hadoop daemons > ---------------------------------------------------------------- > > Key: HADOOP-2062 > URL: https://issues.apache.org/jira/browse/HADOOP-2062 > Project: Hadoop Core > Issue Type: Improvement > Components: dfs, mapred > Reporter: Arun C Murthy > Assignee: Arun C Murthy > > There are several long-running, independent, threads in hadoop daemons (atleast in the JobTracker - e.g. ExpireLaunchingTasks, ExpireTrackers, TaskCommitQueue etc.) which need to be alive as long as the daemon itself and hence should be impervious to various errors and exceptions (e.g. HADOOP-2051). > Currently, each of them seem to be hand-crafted (again, specifically the JobTracker) and different from the other. > I propose we standardize on an implementation of a long-running, impervious, daemon-thread which can be used all over the shop. That thread should be explicitly shut-down by the hadoop daemon and shouldn't be vulnerable to any exceptions/errors. > This mostly likely will look like this: > {noformat} > public abstract class DaemonThread extends Thread { > public static final Log LOG = LogFactory.getLog(DaemonThread.class); > { > setDaemon(true); // always a daemon > } > public abstract void innerLoop() throws InterruptedException; > > public final void run() { > while (!isInterrupted()) { > try { > innerLoop(); > } catch (InterruptedException ie) { > LOG.warn(getName() + " interrupted, exiting..."); > } catch (Throwable t) { > LOG.error(getName() + " got an exception: " + > StringUtils.stringifyException(t)); > } > } > } > } > {noformat} > In fact, we could probably hijack org.apache.hadoop.util.Daemon since it isn't used anywhere (Doug is it still used in nutch?) or atleast sub-class that. > Thoughts? Could someone from hdfs/hbase chime in? -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.