You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yarn-dev@hadoop.apache.org by "hunshenshi (JIRA)" <ji...@apache.org> on 2019/06/05 06:40:00 UTC

[jira] [Created] (YARN-9601) Potential NPE in ZookeeperFederationStateStore#getPoliciesConfigurations

hunshenshi created YARN-9601:
--------------------------------

             Summary: Potential NPE in ZookeeperFederationStateStore#getPoliciesConfigurations
                 Key: YARN-9601
                 URL: https://issues.apache.org/jira/browse/YARN-9601
             Project: Hadoop YARN
          Issue Type: Bug
          Components: federation, yarn
    Affects Versions: 3.2.0
            Reporter: hunshenshi


Potential NPE in ZookeeperFederationStateStore#getPoliciesConfigurations

The code of ZookeeperFederationStateStore#getPoliciesConfigurations
{code:java}
for (String child : zkManager.getChildren(policiesZNode)) {
  SubClusterPolicyConfiguration policy = getPolicy(child);
  result.add(policy);
}
{code}
The result of `getPolicy` may be null, so policy should be checked 

The new code 
{code:java}
for (String child : zkManager.getChildren(policiesZNode)) {
  SubClusterPolicyConfiguration policy = getPolicy(child);
  // policy maybe null, should check
  if (policy == null) {
    LOG.warn("Policy for queue: {} does not exist.", child);
    continue;
  }
  result.add(policy);
}
{code}
 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-dev-unsubscribe@hadoop.apache.org
For additional commands, e-mail: yarn-dev-help@hadoop.apache.org