YARN-8164. Fix a potential NPE in AbstractSchedulerPlanFollower. Contributed by lujie.

This commit is contained in:
Inigo Goiri 2018-04-16 17:32:19 -07:00
parent dd5e18c4ae
commit f1461b2487

View File

@ -263,7 +263,10 @@ protected void cleanupExpiredQueues(String planQueueName, boolean shouldMove,
if (shouldMove) {
moveAppsInQueueSync(expiredReservation, defReservationQueue);
}
if (scheduler.getAppsInQueue(expiredReservation).size() > 0) {
List<ApplicationAttemptId> appsInQueue = scheduler.
getAppsInQueue(expiredReservation);
int size = (appsInQueue == null ? 0 : appsInQueue.size());
if (size > 0) {
scheduler.killAllAppsInQueue(expiredReservation);
LOG.info("Killing applications in queue: {}", expiredReservation);
} else {