YARN-3369. Missing NullPointer check in AppSchedulingInfo causes RM to die. (Brahma Reddy Battula via wangda)

This commit is contained in:
Wangda Tan 2015-03-20 10:42:05 -07:00
parent 1a4b528691
commit 6bc7710ec7
2 changed files with 9 additions and 4 deletions

View File

@ -802,6 +802,9 @@ Release 2.7.0 - UNRELEASED
YARN-3379. Fixed missing data in localityTable and ResourceRequests table
in RM WebUI. (Xuan Gong via jianhe)
YARN-3369. Missing NullPointer check in AppSchedulingInfo causes RM to die.
(Brahma Reddy Battula via wangda)
Release 2.6.0 - 2014-11-18
INCOMPATIBLE CHANGES

View File

@ -239,7 +239,7 @@ public class AppSchedulingInfo {
public synchronized Resource getResource(Priority priority) {
ResourceRequest request = getResourceRequest(priority, ResourceRequest.ANY);
return request.getCapability();
return (request == null) ? null : request.getCapability();
}
public synchronized boolean isBlacklisted(String resourceName) {
@ -382,11 +382,13 @@ public class AppSchedulingInfo {
boolean deactivate = true;
for (Priority priority : getPriorities()) {
ResourceRequest request = getResourceRequest(priority, ResourceRequest.ANY);
if (request != null) {
if (request.getNumContainers() > 0) {
deactivate = false;
break;
}
}
}
if (deactivate) {
activeUsersManager.deactivateApplication(user, applicationId);
}