Prechádzať zdrojové kódy

YARN-11668. Fix RM crash for potential concurrent modification exception when updating node attributes (#6681) Contributed by Junfan Zhang.

Reviewed-by: Dinesh Chitlangia <dineshc@apache.org>
Signed-off-by: Shilun Fan <slfan1989@apache.org>
Junfan Zhang 1 rok pred
rodič
commit
f1f2abe641

+ 1 - 1
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/nodelabels/NodeAttributesManagerImpl.java

@@ -613,7 +613,7 @@ public class NodeAttributesManagerImpl extends NodeAttributesManager {
     }
 
     public Host(String hostName) {
-      this(hostName, new HashMap<NodeAttribute, AttributeValue>());
+      this(hostName, new ConcurrentHashMap<NodeAttribute, AttributeValue>());
     }
 
     public Host(String hostName,