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. mechanisms are enabled and thus fix YARN/MR test failures after HADOOP-9421.
(Daryn Sharp and Vinod Kumar Vavilapalli via vinodkv) (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 BREAKDOWN OF HADOOP-8562 SUBTASKS AND RELATED JIRAS
YARN-158. Yarn creating package-info.java must not depend on sh. YARN-158. Yarn creating package-info.java must not depend on sh.

View File

@ -801,9 +801,10 @@ public class LeafQueue implements CSQueue {
if (reservedContainer != null) { if (reservedContainer != null) {
FiCaSchedulerApp application = FiCaSchedulerApp application =
getApplication(reservedContainer.getApplicationAttemptId()); getApplication(reservedContainer.getApplicationAttemptId());
return synchronized (application) {
assignReservedContainer(application, node, reservedContainer, return assignReservedContainer(application, node, reservedContainer,
clusterResource); clusterResource);
}
} }
// Try to assign containers to applications in order // Try to assign containers to applications in order

View File

@ -38,6 +38,7 @@ import org.apache.hadoop.yarn.api.records.NodeId;
import org.apache.hadoop.yarn.api.records.Priority; import org.apache.hadoop.yarn.api.records.Priority;
import org.apache.hadoop.yarn.api.records.Resource; import org.apache.hadoop.yarn.api.records.Resource;
import org.apache.hadoop.yarn.api.records.ResourceRequest; 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.factories.RecordFactory;
import org.apache.hadoop.yarn.factory.providers.RecordFactoryProvider; import org.apache.hadoop.yarn.factory.providers.RecordFactoryProvider;
import org.apache.hadoop.yarn.server.resourcemanager.RMAuditLogger; import org.apache.hadoop.yarn.server.resourcemanager.RMAuditLogger;
@ -426,6 +427,16 @@ public class FiCaSchedulerApp extends SchedulerApplication {
this.reservedContainers.remove(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 // Reset the re-reservation count
resetReReservations(priority); resetReReservations(priority);