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