YARN-10295. CapacityScheduler NPE can cause apps to get stuck without resources. Contributed by Benjamin Teke
This commit is contained in:
parent
0c209f3f7d
commit
59b20a1ebf
|
@ -1554,11 +1554,14 @@ public class CapacityScheduler extends
|
|||
}
|
||||
|
||||
// Do not schedule if there are any reservations to fulfill on the node
|
||||
if (node.getReservedContainer() != null) {
|
||||
// node.getReservedContainer() is saved to the reservedContainer variable
|
||||
// to ensure that a NPE described in YARN-10295 won't occur
|
||||
reservedContainer = node.getReservedContainer();
|
||||
if (reservedContainer != null) {
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Skipping scheduling since node " + node.getNodeID()
|
||||
+ " is reserved by application " + node.getReservedContainer()
|
||||
.getContainerId().getApplicationAttemptId());
|
||||
+ " is reserved by application " + reservedContainer
|
||||
.getContainerId().getApplicationAttemptId());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue