YARN-845. RM crash with NPE on NODE_UPDATE (Mayank Bansal via bikas)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1499886 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Bikas Saha 2013-07-04 23:31:26 +00:00
parent 5428bfbf53
commit eff5d9b17e
3 changed files with 17 additions and 3 deletions

View File

@ -663,6 +663,8 @@ Release 2.1.0-beta - 2013-07-02
mechanisms are enabled and thus fix YARN/MR test failures after HADOOP-9421.
(Daryn Sharp and Vinod Kumar Vavilapalli via vinodkv)
YARN-845. RM crash with NPE on NODE_UPDATE (Mayank Bansal via bikas)
BREAKDOWN OF HADOOP-8562 SUBTASKS AND RELATED JIRAS
YARN-158. Yarn creating package-info.java must not depend on sh.

View File

@ -801,10 +801,11 @@ private synchronized FiCaSchedulerApp getApplication(
if (reservedContainer != null) {
FiCaSchedulerApp application =
getApplication(reservedContainer.getApplicationAttemptId());
return
assignReservedContainer(application, node, reservedContainer,
synchronized (application) {
return assignReservedContainer(application, node, reservedContainer,
clusterResource);
}
}
// Try to assign containers to applications in order
for (FiCaSchedulerApp application : activeApplications) {

View File

@ -38,6 +38,7 @@
import org.apache.hadoop.yarn.api.records.Priority;
import org.apache.hadoop.yarn.api.records.Resource;
import org.apache.hadoop.yarn.api.records.ResourceRequest;
import org.apache.hadoop.yarn.exceptions.YarnRuntimeException;
import org.apache.hadoop.yarn.factories.RecordFactory;
import org.apache.hadoop.yarn.factory.providers.RecordFactoryProvider;
import org.apache.hadoop.yarn.server.resourcemanager.RMAuditLogger;
@ -426,6 +427,16 @@ public synchronized void unreserve(FiCaSchedulerNode node, Priority priority) {
this.reservedContainers.remove(priority);
}
// reservedContainer should not be null here
if (reservedContainer == null) {
String errorMesssage =
"Application " + getApplicationId() + " is trying to unreserve "
+ " on node " + node + ", currently has "
+ reservedContainers.size() + " at priority " + priority
+ "; currentReservation " + currentReservation;
LOG.warn(errorMesssage);
throw new YarnRuntimeException(errorMesssage);
}
// Reset the re-reservation count
resetReReservations(priority);