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 46480200B61 for ; Tue, 5 Jul 2016 00:57:13 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 44D07160A65; Mon, 4 Jul 2016 22:57:13 +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 B1534160A6D for ; Tue, 5 Jul 2016 00:57:12 +0200 (CEST) Received: (qmail 77770 invoked by uid 500); 4 Jul 2016 22:57:11 -0000 Mailing-List: contact common-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-dev@hadoop.apache.org Received: (qmail 77492 invoked by uid 99); 4 Jul 2016 22:57:11 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Jul 2016 22:57:11 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 0C4562C02A4 for ; Mon, 4 Jul 2016 22:57:11 +0000 (UTC) Date: Mon, 4 Jul 2016 22:57:11 +0000 (UTC) From: "Tsuyoshi Ozawa (JIRA)" To: common-dev@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (HADOOP-13339) MetricsSourceAdapter#updateAttrCache may throw NPE due to NULL lastRecs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 04 Jul 2016 22:57:13 -0000 [ https://issues.apache.org/jira/browse/HADOOP-13339?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Tsuyoshi Ozawa resolved HADOOP-13339. ------------------------------------- Resolution: Duplicate Dup of HADOOP-11361. Closing this. > MetricsSourceAdapter#updateAttrCache may throw NPE due to NULL lastRecs > ----------------------------------------------------------------------- > > Key: HADOOP-13339 > URL: https://issues.apache.org/jira/browse/HADOOP-13339 > Project: Hadoop Common > Issue Type: Bug > Reporter: Yongjun Zhang > Assignee: Yongjun Zhang > > The for loop below may find lastRecs NULL > {code} > private int updateAttrCache() { > LOG.debug("Updating attr cache..."); > int recNo = 0; > int numMetrics = 0; > for (MetricsRecordImpl record : lastRecs) { > for (MetricsTag t : record.tags()) { > setAttrCacheTag(t, recNo); > ++numMetrics; > } > for (AbstractMetric m : record.metrics()) { > setAttrCacheMetric(m, recNo); > ++numMetrics; > } > ++recNo; > } > LOG.debug("Done. # tags & metrics="+ numMetrics); > return numMetrics; > } > {code} > and throws NPE. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: common-dev-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-dev-help@hadoop.apache.org