Forráskód Böngészése

Bug fix to set correct state on containers so as to avoid duplicate containers from RM to AM. Contributed by Vinod Kumar Vavilapalli.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/MR-279@1136310 13f79535-47bb-0310-9956-ffa450edef68
Vinod Kumar Vavilapalli 14 éve
szülő
commit
8b57a0a19a

+ 4 - 1
mapreduce/CHANGES.txt

@@ -5,7 +5,10 @@ Trunk (unreleased changes)
 
     MAPREDUCE-279
 
-    Adding attempts page to the history server UI. (vinodkv
+    Bug fix to set correct state on containers so as to avoid duplicate
+    containers from RM to AM. (vinodkv)
+
+    Adding attempts page to the history server UI. (vinodkv)
 
     Task diagnostic info made available on the AM UI. (vinodkv)
 

+ 7 - 0
mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ApplicationMasterService.java

@@ -44,6 +44,7 @@ import org.apache.hadoop.yarn.api.records.ApplicationId;
 import org.apache.hadoop.yarn.api.records.ApplicationMaster;
 import org.apache.hadoop.yarn.api.records.ApplicationStatus;
 import org.apache.hadoop.yarn.api.records.Container;
+import org.apache.hadoop.yarn.api.records.ContainerState;
 import org.apache.hadoop.yarn.api.records.ResourceRequest;
 import org.apache.hadoop.yarn.conf.YarnConfiguration;
 import org.apache.hadoop.yarn.event.EventHandler;
@@ -152,6 +153,12 @@ AMRMProtocol, EventHandler<ASMEvent<ApplicationTrackerEventType>> {
     ApplicationStatus status = request.getApplicationStatus();
     List<ResourceRequest> ask = request.getAskList();
     List<Container> release = request.getReleaseList();
+    // TODO: This is a hack. Arbitrary changing state can screw things up.
+    // Set Container state as complete, as this will be returned back to AM as
+    // is to inform AM of the list of completed containers.
+    for (Container container : release) {
+      container.setState(ContainerState.COMPLETE);
+    }
     try {
       /* check if its in cache */
       synchronized(responseMap) {