YARN-7489. ConcurrentModificationException in RMAppImpl#getRMAppMetrics. Contributed by Tao Yang.
This commit is contained in:
parent
96e6a99360
commit
b5b81a4f08
|
@ -1641,7 +1641,8 @@ public class RMAppImpl implements RMApp, Recoverable {
|
||||||
int numNonAMContainerPreempted = 0;
|
int numNonAMContainerPreempted = 0;
|
||||||
Map<String, Long> resourceSecondsMap = new HashMap<>();
|
Map<String, Long> resourceSecondsMap = new HashMap<>();
|
||||||
Map<String, Long> preemptedSecondsMap = new HashMap<>();
|
Map<String, Long> preemptedSecondsMap = new HashMap<>();
|
||||||
|
this.readLock.lock();
|
||||||
|
try {
|
||||||
for (RMAppAttempt attempt : attempts.values()) {
|
for (RMAppAttempt attempt : attempts.values()) {
|
||||||
if (null != attempt) {
|
if (null != attempt) {
|
||||||
RMAppAttemptMetrics attemptMetrics =
|
RMAppAttemptMetrics attemptMetrics =
|
||||||
|
@ -1671,6 +1672,9 @@ public class RMAppImpl implements RMApp, Recoverable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} finally {
|
||||||
|
this.readLock.unlock();
|
||||||
|
}
|
||||||
|
|
||||||
return new RMAppMetrics(resourcePreempted, numNonAMContainerPreempted,
|
return new RMAppMetrics(resourcePreempted, numNonAMContainerPreempted,
|
||||||
numAMContainerPreempted, resourceSecondsMap, preemptedSecondsMap);
|
numAMContainerPreempted, resourceSecondsMap, preemptedSecondsMap);
|
||||||
|
|
Loading…
Reference in New Issue