[jboss-jira] [JBoss JIRA] Updated: (JBRULES-2912) Drools Planner Divide By Zero Error
David Faulkner (JIRA)
jira-events at lists.jboss.org
Tue Mar 1 10:33:05 EST 2011
[ https://issues.jboss.org/browse/JBRULES-2912?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
David Faulkner updated JBRULES-2912:
------------------------------------
Description:
In org.drools.planner.core.localsearch.DefaultLocalSearchSolver::solvingEnded, there is potentially a divide by zero that occurs on the line:
long averageCalculateCountPerSecond = localSearchSolverScope.getCalculateCount() * 1000L / timeMillisSpend;
if timeMillisSpend is zero. Although in theory the likelihood of this occurring in practically nothing, we have actually seen it occur on a POC project with long running Planner jobs. An appropriate guard should be added to this calculation to ensure that this error cannot occur.
was:
In org.drools.palnner.core.localsearch.DefaultLocalSearchSolver::solvingEnded, there is potentially a divide by zero that occurs on the line:
long averageCalculateCountPerSecond = localSearchSolverScope.getCalculateCount() * 1000L / timeMillisSpend;
if timeMillisSpend is zero. Although in theory the likelihood of this occurring in practically nothing, we have actually seen it occur on a POC project with long running Planner jobs. An appropriate guard should be added to this calculation to ensure that this error cannot occur.
> Drools Planner Divide By Zero Error
> -----------------------------------
>
> Key: JBRULES-2912
> URL: https://issues.jboss.org/browse/JBRULES-2912
> Project: Drools
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: drools-planner
> Affects Versions: 5.1.1.FINAL
> Environment: Windows, Intel desktop-class, Java6 (bug is not environment-specific)
> Reporter: David Faulkner
> Assignee: Mark Proctor
> Labels: bug
>
> In org.drools.planner.core.localsearch.DefaultLocalSearchSolver::solvingEnded, there is potentially a divide by zero that occurs on the line:
> long averageCalculateCountPerSecond = localSearchSolverScope.getCalculateCount() * 1000L / timeMillisSpend;
> if timeMillisSpend is zero. Although in theory the likelihood of this occurring in practically nothing, we have actually seen it occur on a POC project with long running Planner jobs. An appropriate guard should be added to this calculation to ensure that this error cannot occur.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list