From ec2fd013334b83cccec53b03ef3e26c1668d1a89 Mon Sep 17 00:00:00 2001 From: minni31 Date: Tue, 1 Feb 2022 23:07:40 +0530 Subject: [PATCH] =?UTF-8?q?YARN-10459.=20containerLaunchedOnNode=20method?= =?UTF-8?q?=20not=20need=20to=20hold=20scheduler=E2=80=A6=20(#3195)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scheduler/SchedulerApplicationAttempt.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/SchedulerApplicationAttempt.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/SchedulerApplicationAttempt.java index c50ee56738..2c84d39924 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/SchedulerApplicationAttempt.java +++ b/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 int getNumReservedContainers( @SuppressWarnings("unchecked") public void containerLaunchedOnNode(ContainerId containerId, NodeId nodeId) { - writeLock.lock(); + readLock.lock(); try { // Inform the container RMContainer rmContainer = getRMContainer(containerId); @@ -670,7 +670,7 @@ public void containerLaunchedOnNode(ContainerId containerId, rmContainer.handle( new RMContainerEvent(containerId, RMContainerEventType.LAUNCHED)); } finally { - writeLock.unlock(); + readLock.unlock(); } }