You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "Yongjun Zhang (JIRA)" <ji...@apache.org> on 2016/07/04 22:50:10 UTC
[jira] [Created] (HADOOP-13339)
MetricsSourceAdapter#updateAttrCache may throw NPE due to NULL lastRecs
Yongjun Zhang created HADOOP-13339:
--------------------------------------
Summary: 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