فهرست منبع

Fix concurrent modification exception in the Capacity Scheduler (mahadev)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/MR-279@1135920 13f79535-47bb-0310-9956-ffa450edef68
Mahadev Konar 14 سال پیش
والد
کامیت
403ca56cb0

+ 2 - 0
mapreduce/CHANGES.txt

@@ -5,6 +5,8 @@ Trunk (unreleased changes)
 
 
     MAPREDUCE-279
     MAPREDUCE-279
 
 
+    Fix concurrent modification exception in the Capacity Scheduler (mahadev)
+
     Changes for invoking rack resolution in the RM and in the AM (ddas)
     Changes for invoking rack resolution in the RM and in the AM (ddas)
 
 
     Fix ClassCastException in JobHistoryServer for certain jobs.
     Fix ClassCastException in JobHistoryServer for certain jobs.

+ 1 - 1
mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/applicationsmanager/AMTracker.java

@@ -262,7 +262,7 @@ public class AMTracker extends AbstractService  implements EventHandler<ASMEvent
     masterInfo.getMaster().setDiagnostics(
     masterInfo.getMaster().setDiagnostics(
         remoteApplicationMaster.getDiagnostics());
         remoteApplicationMaster.getDiagnostics());
 
 
-    rmContext.getDispatcher().getSyncHandler().handle(
+    rmContext.getDispatcher().getEventHandler().handle(
         new ApplicationFinishEvent(masterInfo, remoteApplicationMaster
         new ApplicationFinishEvent(masterInfo, remoteApplicationMaster
             .getState()));
             .getState()));
   }
   }

+ 2 - 1
mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacityScheduler.java

@@ -27,6 +27,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Map;
 import java.util.Set;
 import java.util.Set;
 import java.util.TreeMap;
 import java.util.TreeMap;
+import java.util.TreeSet;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentHashMap;
 
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.Log;
@@ -556,7 +557,7 @@ implements ResourceScheduler, CapacitySchedulerContext {
     Map<Priority, Set<NodeInfo>> reservations = application.getAllReservations();
     Map<Priority, Set<NodeInfo>> reservations = application.getAllReservations();
     for (Map.Entry<Priority, Set<NodeInfo>> e : reservations.entrySet()) {
     for (Map.Entry<Priority, Set<NodeInfo>> e : reservations.entrySet()) {
       Priority priority = e.getKey();
       Priority priority = e.getKey();
-      Set<NodeInfo> reservedNodes = e.getValue();
+      Set<NodeInfo> reservedNodes = new TreeSet<NodeInfo>(e.getValue());
       for (NodeInfo node : reservedNodes) {
       for (NodeInfo node : reservedNodes) {
         Resource allocatedResource = 
         Resource allocatedResource = 
           application.getResourceRequest(priority, NodeManagerImpl.ANY).getCapability();
           application.getResourceRequest(priority, NodeManagerImpl.ANY).getCapability();