You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2019/06/05 06:56:47 UTC
[GitHub] [hadoop] hunshenshi opened a new pull request #908: YARN-9601:Potential NPE in ZookeeperFederationStateStore#getPoliciesC…
hunshenshi opened a new pull request #908: YARN-9601:Potential NPE in ZookeeperFederationStateStore#getPoliciesC…
URL: https://github.com/apache/hadoop/pull/908
Potential NPE in ZookeeperFederationStateStore#getPoliciesConfigurations
The code of ZookeeperFederationStateStore#getPoliciesConfigurations
``` java
for (String child : zkManager.getChildren(policiesZNode)) {
SubClusterPolicyConfiguration policy = getPolicy(child);
result.add(policy);
}
```
The result of `getPolicy` may be null, so policy should be checked
The new 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);
}
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org