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

Potential null dereference in CommonNodeLabelsManager#internalRemoveLabelsFromNode()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Not A Problem
    • None
    • None
    • None
    • None

    Description

      Here is the code (around line 475):

            if (nodeId.getPort() == WILDCARD_PORT) {
              Host host = nodeCollections.get(nodeId.getHost());
              host.labels.removeAll(labels);
              newNMToLabels.put(nodeId, host.labels);
            } else {
              Node nm = getNMInNodeSet(nodeId);
              if (nm.labels != null) {
      

      nm may be null in else block.
      In other places, node is created if non-existent:

            } else {
              createNodeIfNonExisted(nodeId);
              Node nm = getNMInNodeSet(nodeId);
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            yuzhihong@gmail.com Ted Yu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: