From 0cc98ae0ec69419ded066f3f7decf59728b35e9d Mon Sep 17 00:00:00 2001 From: Jian He Date: Wed, 1 Nov 2017 17:00:32 -0700 Subject: [PATCH] YARN-7396. NPE when accessing container logs due to null dirsHandler. Contributed by Jonathan Hung --- .../org/apache/hadoop/yarn/server/nodemanager/NodeManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeManager.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeManager.java index 7a6106e195d..bddc7c34ee7 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeManager.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeManager.java @@ -367,6 +367,8 @@ public class NodeManager extends CompositeService this.aclsManager = new ApplicationACLsManager(conf); + this.dirsHandler = new LocalDirsHandlerService(metrics); + boolean isDistSchedulingEnabled = conf.getBoolean(YarnConfiguration.DIST_SCHEDULING_ENABLED, YarnConfiguration.DEFAULT_DIST_SCHEDULING_ENABLED); @@ -390,7 +392,6 @@ public class NodeManager extends CompositeService // NodeManager level dispatcher this.dispatcher = new AsyncDispatcher("NM Event dispatcher"); - dirsHandler = new LocalDirsHandlerService(metrics); nodeHealthChecker = new NodeHealthCheckerService( getNodeHealthScriptRunner(conf), dirsHandler);