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

Fix a potential NPE in AbstractSchedulerPlanFollower

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.0-beta1
    • Fix Version/s: 2.10.0, 3.2.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      We have developed a static analysis tool NPEDetector to find some potential NPE. Our analysis shows that some callees may return null in corner case(e.g. node crash , IO exception), some of their callers have  !=null check but some do not have.

      Callee FairScheduler#getAppsInQueue can return null

      public List<ApplicationAttemptId> getAppsInQueue(String queueName) {
          FSQueue queue = queueMgr.getQueue(queueName);
         if (queue == null) {
            return null;//here
        }
      }
      

      it has 4 callers, three of them have null checker, one does not have. In this issue we post a patch which can add  !=null  based on existed !=null  check.

        Attachments

        1. YARN-8146_1.patch
          1 kB
          lujie
        2. YARN-8146_2.patch
          1 kB
          lujie

          Activity

            People

            • Assignee:
              xiaoheipangzi lujie
              Reporter:
              xiaoheipangzi lujie
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: