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
1 changed files with 5 additions and 0 deletions

View File

@ -842,6 +842,11 @@ public abstract class AbstractYarnScheduler
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();