GitHub user lujiefsi opened a pull request:

    https://github.com/apache/storm/pull/2654

    Storm 3050:a potential NPE in ConstraintSolverStrategy#checkResourcesCorrect

    We have developed a static analysis tool [NPEDetector 
](https://github.com/lujiefsi/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:
    callee TopologyDetails#getTotalCpuReqTask have two callers, one of them 
have null checker:
    <pre> 
        public double getTotalRequestedCpu() {
        double totalCpu = 0.0;
        for (ExecutorDetails exec : this.getExecutors()) {
             Double execCpu = getTotalCpuReqTask(exec);
            if (execCpu != null) {
                totalCpu += execCpu;
            }
       }
       return totalCpu;
    }
    </pre>
    but ConstraintSolverStrategy#checkResourcesCorrect have no checker:
    <pre> 
    for (ExecutorDetails executor : entry.getValue()) {
          supervisorUsedCpu += topology.getTotalCpuReqTask(executor);
    }
    </pre>

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/lujiefsi/storm STORM-3050

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/storm/pull/2654.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2654
    
----
commit 5bc516005cd57b62caabcc2fd99202b368cc5d9f
Author: LJ1043041006 <1239497420@...>
Date:   2018-05-02T09:42:21Z

    fixing STORM-3050

commit e43c21f1277991ac31a61d4a5816efa07ab4cf0a
Author: LJ1043041006 <1239497420@...>
Date:   2018-05-02T10:26:15Z

    fix STORM-3050

commit 2baf5b9edf0c68fb0919f7a9ae15cea2c269529e
Author: LJ1043041006 <1239497420@...>
Date:   2018-05-02T10:28:16Z

    fix STORM-3050

----


---

Reply via email to