Return-Path: X-Original-To: apmail-hawq-dev-archive@minotaur.apache.org Delivered-To: apmail-hawq-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 71B2718CED for ; Wed, 3 Feb 2016 10:23:32 +0000 (UTC) Received: (qmail 10811 invoked by uid 500); 3 Feb 2016 10:23:23 -0000 Delivered-To: apmail-hawq-dev-archive@hawq.apache.org Received: (qmail 10755 invoked by uid 500); 3 Feb 2016 10:23:22 -0000 Mailing-List: contact dev-help@hawq.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hawq.incubator.apache.org Delivered-To: mailing list dev@hawq.incubator.apache.org Received: (qmail 10739 invoked by uid 99); 3 Feb 2016 10:23:22 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Feb 2016 10:23:22 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 4A8501A0467 for ; Wed, 3 Feb 2016 10:23:22 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.565 X-Spam-Level: X-Spam-Status: No, score=-4.565 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.545] autolearn=disabled Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id HAbrzeA_2o4H for ; Wed, 3 Feb 2016 10:23:21 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with SMTP id 3DF1343E8A for ; Wed, 3 Feb 2016 10:23:21 +0000 (UTC) Received: (qmail 10710 invoked by uid 99); 3 Feb 2016 10:23:20 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Feb 2016 10:23:20 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id BCBE6DFC8F; Wed, 3 Feb 2016 10:23:20 +0000 (UTC) From: huor To: dev@hawq.incubator.apache.org Reply-To: dev@hawq.incubator.apache.org References: In-Reply-To: Subject: [GitHub] incubator-hawq pull request: HAWQ-252. fix a coredump when yarn he... Content-Type: text/plain Message-Id: <20160203102320.BCBE6DFC8F@git1-us-west.apache.org> Date: Wed, 3 Feb 2016 10:23:20 +0000 (UTC) Github user huor commented on a diff in the pull request: https://github.com/apache/incubator-hawq/pull/330#discussion_r51702311 --- Diff: depends/libyarn/src/libyarnclient/LibYarnClient.cpp --- @@ -106,7 +106,7 @@ list LibYarnClient::getAskRequests() { void* heartbeatFunc(void* args) { --- End diff -- 1. Do we need to retry here as it already retries in "client->dummyAllocate();"? 2. If we need to retry, the code can be refined as below. The main points are: 1) use macro instead of magic number for maximum retry number 2) provide retry time in logging information 3) use /* ... */ for multiple line comment {noformat} #define HEARTBEAT_MAX_RETRY_NUM 2 int failcounter = 0; LibYarnClient *client = (LibYarnClient*)args; while (client->keepRun) { try { client->dummyAllocate(); failcounter = 0; } catch(const YarnException &e) { failcounter++; LOG(WARNING, "LibYarnClient::heartbeatFunc, dummy allocation " "is not correctly executed in try %d with exception raised. %s", failcounter; e.msg()); if ( failcounter >= HEARTBEAT_MAX_RETRY_NUM ) { /** * In case retry too many times with errors/exceptions, this * thread will return. LibYarn has to re-register application * and start the heartbeat thread again. */ LOG(WARNING, "LibYarnClient::heartbeatFunc, there are too many " "failures raised after %d maximum retries. This heart-beat thread exits now.", HEARTBEAT_MAX_RETRY_NUM); client->keepRun = false; break; } } usleep((client->heartbeatInterval) * 1000); } {noformat} --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---