Revert "HADOOP-11361. Fix a race condition in MetricsSourceAdapter.updateJmxCache. Contributed by Brahma Reddy Battula."
This reverts commit4356e8a5ef
. Conflicts: hadoop-common-project/hadoop-common/CHANGES.txt hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/impl/MetricsSourceAdapter.java (cherry picked from commit17b1a5482b
)
This commit is contained in:
parent
9bd9544bda
commit
2946621a53
|
@ -25,9 +25,6 @@ Release 2.7.3 - UNRELEASED
|
|||
HADOOP-12374. Updated expunge command description.
|
||||
(WeiWei Yang via eyang)
|
||||
|
||||
HADOOP-11361. Fix a race condition in MetricsSourceAdapter.updateJmxCache.
|
||||
(Brahma Reddy Battula via ozawa)
|
||||
|
||||
HADOOP-12348. MetricsSystemImpl creates MetricsSourceAdapter with wrong
|
||||
time unit parameter. (zxu via rkanter)
|
||||
|
||||
|
|
|
@ -158,7 +158,7 @@ class MetricsSourceAdapter implements DynamicMBean {
|
|||
|
||||
private void updateJmxCache() {
|
||||
boolean getAllMetrics = false;
|
||||
synchronized (this) {
|
||||
synchronized(this) {
|
||||
if (Time.now() - jmxCacheTS >= jmxCacheTTL) {
|
||||
// temporarilly advance the expiry while updating the cache
|
||||
jmxCacheTS = Time.now() + jmxCacheTTL;
|
||||
|
@ -169,15 +169,18 @@ class MetricsSourceAdapter implements DynamicMBean {
|
|||
getAllMetrics = true;
|
||||
lastRecsCleared = false;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (getAllMetrics) {
|
||||
MetricsCollectorImpl builder = new MetricsCollectorImpl();
|
||||
getMetrics(builder, true);
|
||||
}
|
||||
|
||||
synchronized(this) {
|
||||
updateAttrCache();
|
||||
if (getAllMetrics) {
|
||||
updateInfoCache();
|
||||
|
|
Loading…
Reference in New Issue