This is an automated email from the ASF dual-hosted git repository.

weichiu pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 22d7d1f  YARN-9601.Potential NPE in 
ZookeeperFederationStateStore#getPoliciesConfigurations (#908) Contributed by 
hunshenshi.
22d7d1f is described below

commit 22d7d1f8bfe64ee04a7611b004ece8a4d4e81ea4
Author: hunshenshi <289517...@qq.com>
AuthorDate: Thu Aug 8 12:26:14 2019 +0800

    YARN-9601.Potential NPE in 
ZookeeperFederationStateStore#getPoliciesConfigurations (#908) Contributed by 
hunshenshi.
---
 .../server/federation/store/impl/ZookeeperFederationStateStore.java   | 4 ++++
 1 file changed, 4 insertions(+)

diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/federation/store/impl/ZookeeperFederationStateStore.java
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/federation/store/impl/ZookeeperFederationStateStore.java
index fde5f2c..39f498c 100644
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/federation/store/impl/ZookeeperFederationStateStore.java
+++ 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/federation/store/impl/ZookeeperFederationStateStore.java
@@ -422,6 +422,10 @@ public class ZookeeperFederationStateStore implements 
FederationStateStore {
     try {
       for (String child : zkManager.getChildren(policiesZNode)) {
         SubClusterPolicyConfiguration policy = getPolicy(child);
+        if (policy == null) {
+          LOG.warn("Policy for queue: {} does not exist.", child);
+          continue;
+        }
         result.add(policy);
       }
     } catch (Exception e) {


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-commits-h...@hadoop.apache.org

Reply via email to