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:18:12 -07:00 committed by Xiaoyu Yao
parent a36e041f5f
commit ae743ff258
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