From 70315de4ff8409a6bdcf3305043439970782ed98 Mon Sep 17 00:00:00 2001 From: Vrushali Channapattan Date: Tue, 9 May 2017 11:15:24 -0700 Subject: [PATCH] YARN-6563 ConcurrentModificationException in TimelineCollectorManager while stopping RM (Contributed by Haibo Chen via Vrushali C) --- .../timelineservice/collector/TimelineCollectorManager.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/collector/TimelineCollectorManager.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/collector/TimelineCollectorManager.java index 8ef9b43d517..07cbb2b24ec 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/collector/TimelineCollectorManager.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/collector/TimelineCollectorManager.java @@ -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