YARN-6563 ConcurrentModificationException in TimelineCollectorManager while stopping RM (Contributed by Haibo Chen via Vrushali C)

This commit is contained in:
Vrushali Channapattan 2017-05-09 11:15:24 -07:00 committed by Varun Saxena
parent 34570d4fc3
commit 70315de4ff
1 changed files with 4 additions and 2 deletions

View File

@ -219,8 +219,10 @@ public class TimelineCollectorManager extends AbstractService {
@Override
protected void serviceStop() throws Exception {
if (collectors != null && collectors.size() > 1) {
for (TimelineCollector c : collectors.values()) {
c.serviceStop();
synchronized (collectors) {
for (TimelineCollector c : collectors.values()) {
c.serviceStop();
}
}
}
// stop the flusher first