Uploaded image for project: 'Apache Storm'
  1. Apache Storm
  2. STORM-3048

A Potential NPE

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.0.0
    • None

    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. 

      Bug:

      Cluster#getAssignmentById has 20 callers, 18 callers have null checker like this:

      SchedulerAssignment assignment = cluster.getAssignmentById(td.getId());
      if (assignment != null) {
          cpuNeeded -= getCpuUsed(assignment);
           memoryNeeded -= getMemoryUsed(assignment);
      }
      

      the caller have no null checker :ConstraintSolverStrategy#checkSpreadSchedulingValid ConstraintSolverStrategy#checkConstraintsSatisfied.

      Attachments

        Issue Links

          Activity

            People

              xiaoheipangzi lujie
              xiaoheipangzi lujie
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h
                  1h