From dff710632e9cc401691505fd668417de30b33521 Mon Sep 17 00:00:00 2001 From: Weiwei Yang Date: Wed, 13 Dec 2017 13:11:41 +0800 Subject: [PATCH] YARN-7647. NM print inappropriate error log when node-labels is enabled. Contributed by Yang Wang. --- .../yarn/server/nodemanager/NodeStatusUpdaterImpl.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeStatusUpdaterImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeStatusUpdaterImpl.java index 65bde635a73..b4356cb6abf 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeStatusUpdaterImpl.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeStatusUpdaterImpl.java @@ -1208,9 +1208,12 @@ public class NodeStatusUpdaterImpl extends AbstractService implements public void verifyRMHeartbeatResponseForNodeLabels( NodeHeartbeatResponse response) { if (areLabelsSentToRM) { - if (response.getAreNodeLabelsAcceptedByRM() && LOG.isDebugEnabled()) { - LOG.debug("Node Labels {" + StringUtils.join(",", previousNodeLabels) - + "} were Accepted by RM "); + if (response.getAreNodeLabelsAcceptedByRM()) { + if(LOG.isDebugEnabled()){ + LOG.debug( + "Node Labels {" + StringUtils.join(",", previousNodeLabels) + + "} were Accepted by RM "); + } } else { // case where updated labels from NodeLabelsProvider is sent to RM and // RM rejected the labels