From 52f343598e1a3e737db0774ff767614046295563 Mon Sep 17 00:00:00 2001 From: Rohith Sharma K S Date: Mon, 21 Sep 2015 09:59:30 +0530 Subject: [PATCH] YARN-4167. NPE on RMActiveServices#serviceStop when store is null. (Bibin A Chundatt via rohithsharmaks) (cherry picked from commit c9cb6a5960ad335a3ee93a6ee219eae5aad372f9) --- hadoop-yarn-project/CHANGES.txt | 2 ++ .../hadoop/yarn/server/resourcemanager/ResourceManager.java | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index 79249a05786..7ce60831da5 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -811,6 +811,8 @@ Release 2.8.0 - UNRELEASED YARN-4135. Improve the assertion message in MockRM while failing after waiting for the state. (Nijel S F via rohithsharmaks) + YARN-4167. NPE on RMActiveServices#serviceStop when store is null. (Bibin A Chundatt via rohithsharmaks) + Release 2.7.2 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java index d6d9629c6f7..d1f339a1a84 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java @@ -605,7 +605,9 @@ public class ResourceManager extends CompositeService implements Recoverable { if (rmContext != null) { RMStateStore store = rmContext.getStateStore(); try { - store.close(); + if (null != store) { + store.close(); + } } catch (Exception e) { LOG.error("Error closing store.", e); }