[ https://issues.apache.org/jira/browse/HADOOP-13339?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15362149#comment-15362149 ]
Tsuyoshi Ozawa commented on HADOOP-13339: ----------------------------------------- Thanks [~yzhangal] for taking this issue. {quote} So it doesn't seem a pure synchronization issue. {quote} I think so too. I will comment it on HADOOP-11361, so please wait a moment. > 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-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org