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

(cherry picked from commit 6bc7710ec7)
(cherry picked from commit 8e142d27cb)
(cherry picked from commit 4d43be3c01b1bc0deb31a9081fca5395d0eb4e0d)
This commit is contained in:
Wangda Tan 2015-03-20 10:42:05 -07:00 committed by Vinod Kumar Vavilapalli
parent 553efd7190
commit 005d865494
2 changed files with 9 additions and 4 deletions

View File

@ -114,6 +114,9 @@ Release 2.6.1 - UNRELEASED
YARN-3267. Timelineserver applies the ACL rules after applying the limit on
the number of records (Chang Li via jeagles)
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

@ -236,7 +236,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) {
@ -380,9 +380,11 @@ public class AppSchedulingInfo {
boolean deactivate = true;
for (Priority priority : getPriorities()) {
ResourceRequest request = getResourceRequest(priority, ResourceRequest.ANY);
if (request.getNumContainers() > 0) {
deactivate = false;
break;
if (request != null) {
if (request.getNumContainers() > 0) {
deactivate = false;
break;
}
}
}
if (deactivate) {