GitHub user lujiefsi opened a pull request:
https://github.com/apache/storm/pull/2657
STORM-3048
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:
<pre>
SchedulerAssignment assignment = cluster.getAssignmentById(td.getId());
if (assignment != null) {
cpuNeeded -= getCpuUsed(assignment);
memoryNeeded -= getMemoryUsed(assignment);
}
</pre>
the caller have no null checker
:ConstraintSolverStrategy#checkSpreadSchedulingValid
ConstraintSolverStrategy#checkConstraintsSatisfied.
I was feel uncertain about whether add null checker here, so i only add
assert. If this bug are false positive, please tell me.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/lujiefsi/storm STORM-3048
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/storm/pull/2657.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 #2657
----
commit 924bf795cd8e3974f5c870bc1da1de107c9147a2
Author: LJ1043041006 <1239497420@...>
Date: 2018-05-02T13:26:41Z
fix STORM-3048
----
---