From 5161751433ff6efd2fa03e946d9d4910fae4c0d3 Mon Sep 17 00:00:00 2001 From: Jason Lowe Date: Wed, 13 May 2015 21:06:47 +0000 Subject: [PATCH] YARN-3641. NodeManager: stopRecoveryStore() shouldn't be skipped when exceptions happen in stopping NM's sub-services. Contributed by Junping Du (cherry picked from commit 711d77cc54a64b2c3db70bdacc6bf2245c896a4b) --- hadoop-yarn-project/CHANGES.txt | 3 +++ .../hadoop/yarn/server/nodemanager/NodeManager.java | 11 ++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index 7c81cca0a05..2f9e937f226 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -92,6 +92,9 @@ Release 2.7.1 - UNRELEASED YARN-3537. NPE when NodeManager.serviceInit fails and stopRecoveryStore invoked (Brahma Reddy Battula via jlowe) + YARN-3641. NodeManager: stopRecoveryStore() shouldn't be skipped when + exceptions happen in stopping NM's sub-services. (Junping Du via jlowe) + Release 2.7.0 - 2015-04-20 INCOMPATIBLE CHANGES 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 950031ff68f..2d3d8ff7e99 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 @@ -274,9 +274,14 @@ public class NodeManager extends CompositeService if (isStopping.getAndSet(true)) { return; } - super.serviceStop(); - stopRecoveryStore(); - DefaultMetricsSystem.shutdown(); + try { + super.serviceStop(); + DefaultMetricsSystem.shutdown(); + } finally { + // YARN-3641: NM's services stop get failed shouldn't block the + // release of NMLevelDBStore. + stopRecoveryStore(); + } } public String getName() {