From c9dd2cada055c0beffd04bad0ded8324f66ad1b7 Mon Sep 17 00:00:00 2001 From: Jian He Date: Tue, 7 Jul 2015 14:16:21 -0700 Subject: [PATCH] YARN-3892. Fixed NPE on RMStateStore#serviceStop when CapacityScheduler#serviceInit fails. Contributed by Bibin A Chundatt --- hadoop-yarn-project/CHANGES.txt | 3 +++ .../yarn/server/resourcemanager/recovery/ZKRMStateStore.java | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index 2d1d6a2602f..8b5cc0cd9ba 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -598,6 +598,9 @@ Release 2.8.0 - UNRELEASED YARN-2194. Fix bug causing CGroups functionality to fail on RHEL7. (Wei Yan via vvasudev) + YARN-3892. Fixed NPE on RMStateStore#serviceStop when + CapacityScheduler#serviceInit fails. (Bibin A Chundatt via jianhe) + 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/recovery/ZKRMStateStore.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/recovery/ZKRMStateStore.java index bca534820a9..8f096d882aa 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/recovery/ZKRMStateStore.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/recovery/ZKRMStateStore.java @@ -40,6 +40,7 @@ import org.apache.curator.retry.RetryNTimes; import org.apache.hadoop.classification.InterfaceAudience.Private; import org.apache.hadoop.classification.InterfaceStability.Unstable; import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.io.IOUtils; import org.apache.hadoop.security.token.delegation.DelegationKey; import org.apache.hadoop.util.ZKUtil; import org.apache.hadoop.yarn.api.records.ApplicationAttemptId; @@ -312,7 +313,7 @@ public class ZKRMStateStore extends RMStateStore { verifyActiveStatusThread.interrupt(); verifyActiveStatusThread.join(1000); } - curatorFramework.close(); + IOUtils.closeStream(curatorFramework); } @Override