Return-Path: X-Original-To: apmail-hadoop-yarn-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-yarn-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 5DAD21745C for ; Sat, 8 Nov 2014 03:43:34 +0000 (UTC) Received: (qmail 93862 invoked by uid 500); 8 Nov 2014 03:43:34 -0000 Delivered-To: apmail-hadoop-yarn-issues-archive@hadoop.apache.org Received: (qmail 93822 invoked by uid 500); 8 Nov 2014 03:43:34 -0000 Mailing-List: contact yarn-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: yarn-issues@hadoop.apache.org Delivered-To: mailing list yarn-issues@hadoop.apache.org Received: (qmail 93550 invoked by uid 99); 8 Nov 2014 03:43:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 08 Nov 2014 03:43:34 +0000 Date: Sat, 8 Nov 2014 03:43:34 +0000 (UTC) From: "Tianyin Xu (JIRA)" To: yarn-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (YARN-2832) Wrong Check Logic of NodeHealthCheckerService Causes Latent Errors 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/YARN-2832?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Tianyin Xu updated YARN-2832: ----------------------------- Summary: Wrong Check Logic of NodeHealthCheckerService Causes Latent Errors (was: Wrong Check Logic of Causes Latent Errors) > Wrong Check Logic of NodeHealthCheckerService Causes Latent Errors > ------------------------------------------------------------------ > > Key: YARN-2832 > URL: https://issues.apache.org/jira/browse/YARN-2832 > Project: Hadoop YARN > Issue Type: Bug > Components: nodemanager > Affects Versions: 2.4.1, 2.5.1 > Environment: Any environment > Reporter: Tianyin Xu > Attachments: health.check.service.1.patch > > > NodeManager allows users to specify the health checker script that will be invoked by the health-checker service via the configuration parameter, "_yarn.nodemanager.health-checker.script.path_" > During the _serviceInit()_ of the health-check service, NM checks whether the parameter is set correctly using _shouldRun()_, as follows, > {code:title=/* NodeHealthCheckerService.java */|borderStyle=solid} > protected void serviceInit(Configuration conf) throws Exception { > if (NodeHealthScriptRunner.shouldRun(conf)) { > nodeHealthScriptRunner = new NodeHealthScriptRunner(); > addService(nodeHealthScriptRunner); > } > addService(dirsHandler); > super.serviceInit(conf); > } > {code} > The problem is that if the parameter is misconfigured (e.g., permission problem, wrong path), NM does not have any log message to inform users which could cause latent errors or mysterious problems (e.g., "why my scripts does not work?") > I see the checking and printing logic is put in _serviceStart()_ function in _NodeHealthScriptRunner.java_ (see the following code snippets). However, the logic is very wrong. For an incorrect parameter that does not pass the "shouldRun" check, _serviceStart()_ would never be called because the _NodeHealthScriptRunner_ instance does not have the chance to be created (see the code snippets above). > {code:title=/* NodeHealthScriptRunner.java */|borderStyle=solid} > protected void serviceStart() throws Exception { > // if health script path is not configured don't start the thread. > if (!shouldRun(conf)) { > LOG.info("Not starting node health monitor"); > return; > } > ... > } > {code} > Basically, I think the checking and printing logic should be put in the serviceInit() in NodeHealthCheckerService instead of serviceStart() in NodeHealthScriptRunner. > See the attachment for the simple patch. -- This message was sent by Atlassian JIRA (v6.3.4#6332)