[ 
https://issues.apache.org/jira/browse/STORM-3050?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

lujie updated STORM-3050:
-------------------------
    Labels: pull-request-available  (was: )

> 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
>            Priority: Major
>
> 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:
> {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