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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to