YARN-10651. CapacityScheduler crashed with NPE in AbstractYarnScheduler.updateNodeResource(). Contributed by Haibo Chen

(cherry picked from commit f348ab3f2f468751af329a1ffce4917cb000fcbf)
This commit is contained in:
Jonathan Hung 2021-02-25 15:08:43 -08:00
parent db457b056a
commit be6e99963d

View File

@ -842,6 +842,11 @@ public void updateNodeResource(RMNode nm,
writeLock.lock();
try {
SchedulerNode node = getSchedulerNode(nm.getNodeID());
if (node == null) {
LOG.info("Node: " + nm.getNodeID() + " has already been taken out of " +
"scheduling. Skip updating its resource");
return;
}
Resource newResource = resourceOption.getResource();
final int timeout = resourceOption.getOverCommitTimeout();
Resource oldResource = node.getTotalResource();