浏览代码

YARN-10459. containerLaunchedOnNode method not need to hold scheduler… (#3195)

minni31 3 年之前
父节点
当前提交
ec2fd01333

+ 2 - 2
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/SchedulerApplicationAttempt.java

@@ -656,7 +656,7 @@ public class SchedulerApplicationAttempt implements SchedulableEntity {
   @SuppressWarnings("unchecked")
   @SuppressWarnings("unchecked")
   public void containerLaunchedOnNode(ContainerId containerId,
   public void containerLaunchedOnNode(ContainerId containerId,
       NodeId nodeId) {
       NodeId nodeId) {
-    writeLock.lock();
+    readLock.lock();
     try {
     try {
       // Inform the container
       // Inform the container
       RMContainer rmContainer = getRMContainer(containerId);
       RMContainer rmContainer = getRMContainer(containerId);
@@ -670,7 +670,7 @@ public class SchedulerApplicationAttempt implements SchedulableEntity {
       rmContainer.handle(
       rmContainer.handle(
           new RMContainerEvent(containerId, RMContainerEventType.LAUNCHED));
           new RMContainerEvent(containerId, RMContainerEventType.LAUNCHED));
     } finally {
     } finally {
-      writeLock.unlock();
+      readLock.unlock();
     }
     }
   }
   }