From e787d65a08f5d5245d2313fc34f2dde518bfaa5b Mon Sep 17 00:00:00 2001 From: Jason Lowe Date: Thu, 11 Oct 2018 10:54:57 -0500 Subject: [PATCH] YARN-8861. executorLock is misleading in ContainerLaunch. Contributed by Chandni Singh --- .../containermanager/launcher/ContainerLaunch.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/launcher/ContainerLaunch.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/launcher/ContainerLaunch.java index 6776836d75..f198e83e09 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/launcher/ContainerLaunch.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/launcher/ContainerLaunch.java @@ -135,7 +135,7 @@ public class ContainerLaunch implements Callable { protected final LocalDirsHandlerService dirsHandler; - private final Lock containerExecLock = new ReentrantLock(); + private final Lock launchLock = new ReentrantLock(); public ContainerLaunch(Context context, Configuration configuration, Dispatcher dispatcher, ContainerExecutor exec, Application app, @@ -485,11 +485,11 @@ protected int launchContainer(ContainerStartContext ctx) throws IOException, ConfigurationException { int launchPrep = prepareForLaunch(ctx); if (launchPrep == 0) { - containerExecLock.lock(); + launchLock.lock(); try { return exec.launchContainer(ctx); } finally { - containerExecLock.unlock(); + launchLock.unlock(); } } return launchPrep; @@ -499,18 +499,18 @@ protected int relaunchContainer(ContainerStartContext ctx) throws IOException, ConfigurationException { int launchPrep = prepareForLaunch(ctx); if (launchPrep == 0) { - containerExecLock.lock(); + launchLock.lock(); try { return exec.relaunchContainer(ctx); } finally { - containerExecLock.unlock(); + launchLock.unlock(); } } return launchPrep; } void reapContainer() throws IOException { - containerExecLock.lock(); + launchLock.lock(); try { // Reap the container boolean result = exec.reapContainer( @@ -524,7 +524,7 @@ void reapContainer() throws IOException { } cleanupContainerFiles(getContainerWorkDir()); } finally { - containerExecLock.unlock(); + launchLock.unlock(); } }