lujie created STORM-3050:
----------------------------

             Summary: a potential NPE in 
ConstraintSolverStrategy#checkResourcesCorrect
                 Key: STORM-3050
                 URL: https://issues.apache.org/jira/browse/STORM-3050
             Project: Apache Storm
          Issue Type: Bug
            Reporter: lujie


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#getOnHeapMemoryRequirement have two callers, one have 
null checker:
{code:java}
public double getTotalRequestedCpu() {
double totalCpu = 0.0;
for (ExecutorDetails exec : this.getExecutors()) {
Double execCpu = getTotalCpuReqTask(exec);
if (execCpu != null) {
totalCpu += execCpu;
}
}
return totalCpu;
}
{code}
but ConstraintSolverStrategy#checkResourcesCorrect have no checker:
{code:java}
for (ExecutorDetails executor : entry.getValue()) {
supervisorUsedCpu += topology.getTotalCpuReqTask(executor);
}
{code}
 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to