Uploaded image for project: 'Hadoop YARN'
  1. Hadoop YARN
  2. YARN-9601

Potential NPE in ZookeeperFederationStateStore#getPoliciesConfigurations

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.2.0
    • 3.3.0
    • federation, yarn
    • None

    Description

      Potential NPE in ZookeeperFederationStateStore#getPoliciesConfigurations

      The code of ZookeeperFederationStateStore#getPoliciesConfigurations

      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 

      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);
      }
      

       

      Attachments

        Issue Links

          Activity

            People

              hunhun hunshenshi
              hunhun hunshenshi
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: