Explorar o código

YARN-7249. Fix CapacityScheduler NPE issue when a container preempted while the node is being removed. Contributed by Wangda Tan.

Eric Payne %!s(int64=7) %!d(string=hai) anos
pai
achega
dbdf662c09

+ 3 - 0
hadoop-yarn-project/CHANGES.txt

@@ -26,6 +26,9 @@ Release 2.7.6 - UNRELEASED
     YARN-7590. Improve container-executor validation check.
     Contributed by Eric Yang.
 
+    YARN-7249. Fix CapacityScheduler NPE issue when a container preempted while
+    the node is being removed. (Wangda Tan via Eric Payne)
+
 Release 2.7.5 - 2017-12-14
 
   INCOMPATIBLE CHANGES

+ 6 - 0
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacityScheduler.java

@@ -1428,6 +1428,12 @@ public class CapacityScheduler extends
     
     // Get the node on which the container was allocated
     FiCaSchedulerNode node = getNode(container.getNodeId());
+    if (node == null) {
+      LOG.info("Container=" + container + " of application=" + appId
+          + " completed with event=" + event + " on a node=" + container
+          .getNodeId() + ". However the node might be already removed by RM.");
+      return;
+    }
     
     // Inform the queue
     LeafQueue queue = (LeafQueue)application.getQueue();