diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 47968d336ce..6fc6dcbc17a 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -644,6 +644,9 @@ Release 2.0.5-beta - UNRELEASED HADOOP-9473. Typo in FileUtil copy() method. (Glen Mazza via suresh) + HADOOP-9504. MetricsDynamicMBeanBase has concurrency issues in + createMBeanInfo (Liang Xie via jlowe) + Release 2.0.4-alpha - UNRELEASED INCOMPATIBLE CHANGES @@ -1657,6 +1660,9 @@ Release 0.23.8 - UNRELEASED HADOOP-9469. mapreduce/yarn source jars not included in dist tarball (Robert Parker via tgraves) + HADOOP-9504. MetricsDynamicMBeanBase has concurrency issues in + createMBeanInfo (Liang Xie via jlowe) + Release 0.23.7 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics/util/MetricsDynamicMBeanBase.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics/util/MetricsDynamicMBeanBase.java index ea663a45b37..57014d5781b 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics/util/MetricsDynamicMBeanBase.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics/util/MetricsDynamicMBeanBase.java @@ -18,9 +18,9 @@ package org.apache.hadoop.metrics.util; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import javax.management.Attribute; import javax.management.AttributeList; @@ -69,6 +69,7 @@ public abstract class MetricsDynamicMBeanBase implements DynamicMBean { protected MetricsDynamicMBeanBase(final MetricsRegistry mr, final String aMBeanDescription) { metricsRegistry = mr; mbeanDescription = aMBeanDescription; + metricsRateAttributeMod = new ConcurrentHashMap(); createMBeanInfo(); } @@ -78,7 +79,6 @@ public abstract class MetricsDynamicMBeanBase implements DynamicMBean { } private void createMBeanInfo() { - metricsRateAttributeMod = new HashMap(); boolean needsMinMaxResetOperation = false; List attributesInfo = new ArrayList(); MBeanOperationInfo[] operationsInfo = null;