Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A2972200B71 for ; Wed, 17 Aug 2016 07:58:34 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A1246160ABA; Wed, 17 Aug 2016 05:58:34 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E8AF4160AA8 for ; Wed, 17 Aug 2016 07:58:33 +0200 (CEST) Received: (qmail 56157 invoked by uid 500); 17 Aug 2016 05:58:33 -0000 Mailing-List: contact dev-help@impala.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@impala.incubator.apache.org Delivered-To: mailing list dev@impala.incubator.apache.org Received: (qmail 56140 invoked by uid 99); 17 Aug 2016 05:58:32 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Aug 2016 05:58:32 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id D5C51C0957 for ; Wed, 17 Aug 2016 05:58:31 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.362 X-Spam-Level: X-Spam-Status: No, score=0.362 tagged_above=-999 required=6.31 tests=[RDNS_DYNAMIC=0.363, SPF_PASS=-0.001] autolearn=disabled Received: from mx2-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id s47llFwXKoEo for ; Wed, 17 Aug 2016 05:58:29 +0000 (UTC) Received: from ip-10-146-233-104.ec2.internal (ec2-75-101-130-251.compute-1.amazonaws.com [75.101.130.251]) by mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with ESMTPS id 67AED5FBBC for ; Wed, 17 Aug 2016 05:58:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by ip-10-146-233-104.ec2.internal (8.14.4/8.14.4) with ESMTP id u7H5wTbj018302; Wed, 17 Aug 2016 05:58:29 GMT Message-Id: <201608170558.u7H5wTbj018302@ip-10-146-233-104.ec2.internal> Date: Wed, 17 Aug 2016 05:58:29 +0000 From: "Henry Robinson (Code Review)" To: Kathy Sun , impala-cr@cloudera.com, dev@impala.incubator.apache.org CC: Tim Armstrong Reply-To: henry@cloudera.com X-Gerrit-MessageType: comment Subject: =?UTF-8?Q?=5BImpala-ASF-CR=5D_IMPALA-3981=3A_Fixed_the_bug_of_=22Crash_when_access_statestore/catalog_memz_webpage=22=0A?= X-Gerrit-Change-Id: If59b10f20044d1a468f27810a3029fe18fb19f29 X-Gerrit-ChangeURL: X-Gerrit-Commit: 936058d5753bbae7fe42a7fd790bbbc9b79c869d In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-Disposition: inline User-Agent: Gerrit/2.12.2 archived-at: Wed, 17 Aug 2016 05:58:34 -0000 Henry Robinson has posted comments on this change. Change subject: IMPALA-3981: Fixed the bug of "Crash when access statestore/catalog memz webpage" ...................................................................... Patch Set 2: (8 comments) http://gerrit.cloudera.org:8080/#/c/3998/2//COMMIT_MSG Commit Message: PS2, Line 7: Fixed the bug of "Crash when access statestore/catalog : memz webpage" "Fix crash when accessing statestore / catalogd /memz page" Line 10: Set metric_group as a parameter of AddDefaultUrlCallbacks For a bug like this, the best commit messages often have the following structure: 1. Describe the bug, e.g. : "The /memz page tried to add JVM metrics even when they didn't exist for all daemons, not just Impala. This led to a crash when they tried to access ExecEnv::GetInstance() without an initialised ExecEnv". 2. Describe the fix, e.g.: "To fix, changed the memz handler method to take an optional metric group, provided by the caller." 3. Describe any other details, e.g.: "Used C++11 lambdas rather than boost::bind to help simplify the code" (but consider how important this detail is to the reader) 4. Describe testing - as you have it is fine. http://gerrit.cloudera.org:8080/#/c/3998/2/be/src/runtime/exec-env.cc File be/src/runtime/exec-env.cc: PS2, Line 428: AddDefaultUrlCallbacks You should do this for the catalog page as well, and probably for the statestore (that will test whether your code works when there is no JVM group present). http://gerrit.cloudera.org:8080/#/c/3998/2/be/src/util/default-path-handlers.cc File be/src/util/default-path-handlers.cc: Line 113: MetricGroup* JvmGroup = metric_group->GetChildGroup("jvm"); You should check if the JVM group actually exists first. Unfortunately there's no method to do that in MetricGroup, so please add one that looks like GetChildGroup() but does not create the group if it doesn't exist. Maybe call the new method FindChildGroup()? PS2, Line 113: JvmGroup jvm_group PS2, Line 114: (JvmGroup != NULL) this will never happen when using GetChildGroup(), see above comment. PS2, Line 134: if(metric_group == NULL){ : LOG(INFO)<< "METRIC_GROUP IS NULL!!!!!"; : } Remove! http://gerrit.cloudera.org:8080/#/c/3998/2/be/src/util/default-path-handlers.h File be/src/util/default-path-handlers.h: Line 22: #include "util/metrics.h" rather than including metrics.h, it's better to forward declare MetricGroup like the other classes on lines 26-27. -- To view, visit http://gerrit.cloudera.org:8080/3998 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: If59b10f20044d1a468f27810a3029fe18fb19f29 Gerrit-PatchSet: 2 Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-Owner: Kathy Sun Gerrit-Reviewer: Henry Robinson Gerrit-Reviewer: Kathy Sun Gerrit-Reviewer: Tim Armstrong Gerrit-HasComments: Yes