You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@storm.apache.org by "lujie (JIRA)" <ji...@apache.org> on 2018/04/30 11:58:00 UTC
[jira] [Created] (STORM-3050) a potential NPE in
ConstraintSolverStrategy#checkResourcesCorrect
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)