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

Potential NPE in ZookeeperFederationStateStore#getPoliciesConfigurations

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.2.0
    • Fix Version/s: 3.3.0
    • Component/s: federation, yarn
    • Labels:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: