From 0a5def155eff4564b5dc7685e7460952f51bbd24 Mon Sep 17 00:00:00 2001 From: Ray Chiang Date: Fri, 1 Jul 2016 15:49:30 -0700 Subject: [PATCH] YARN-4568. Fix message when NodeManager runs into errors initializing the recovery directory. (rchiang) --- .../hadoop/yarn/server/nodemanager/NodeManager.java | 9 ++++++++- 1 file changed, 8 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 6ca7ffe6a2e..f7d226e7ecf 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 @@ -287,7 +287,14 @@ public class NodeManager extends CompositeService .RM_WORK_PRESERVING_RECOVERY_ENABLED, YarnConfiguration.DEFAULT_RM_WORK_PRESERVING_RECOVERY_ENABLED); - initAndStartRecoveryStore(conf); + try { + initAndStartRecoveryStore(conf); + } catch (IOException e) { + String recoveryDirName = conf.get(YarnConfiguration.NM_RECOVERY_DIR); + throw new + YarnRuntimeException("Unable to initialize recovery directory at " + + recoveryDirName, e); + } NMContainerTokenSecretManager containerTokenSecretManager = new NMContainerTokenSecretManager(conf, nmStore);