-
Bug
-
Resolution: Done
-
Minor
-
8.11.0.Final
-
None
-
2021 Week 43-45 (from Oct 25)
-
5
-
-
NEW
-
NEW
Got java.lang.ClassCastException when using ConstraintCollectors.toList joining two different entities, for example:
constraintFactory
.from(WaveMeeting.class)
.join(Timeslot.class)
The error is reproduced every other time. It is depends on MoveThreadCount, the bigger MoveThreadCount, the more ofter got error.
MoveThreadCount=8, intel i7 4 cores (macbook pro 2017), macOS 11.6, openjdk 11.0.11
3 failures of 10 runs
MoveThreadCount=10, intel i7 4 cores (macbook pro 2017), macOS 11.6, openjdk 11.0.11
3 failures of 10 runs
MoveThreadCount=10, amazon graviton 2, ec2 instance type c6gmetal, Ubuntu 20.04.2, openjdk 14.0.2
6 failures of 10 runs
MoveThreadCount=64, amazon graviton 2, ec2 instance type c6gmetal, Ubuntu 20.04.2, openjdk 14.0.2
8 failures of 10 runs
MoveThreadCount=96, Intel Xeon Scalable (Cascade Lake), ec2 instance type c5.metal, Ubuntu 20.04.2, openjdk 13.0.7
9 failures of 10 runs
MoveThreadCount=96, AMD EPYC 7002, ec2 instance type c5a.24xlarge, Ubuntu 20.04.2, openjdk 13.0.7
8 failures of 10 runs
Same problem with ConstraintCollectors.toSet.
Source code and data for reproducing: https://github.com/melfa/optaplanner-arm-constraint-bug
Package version is optaplanner-core-8.11.1.
Error output is:
2021-10-21 20:40:54,049 INFO [io.quarkus] (main) optaplanner-quickstart 1.0.0-SNAPSHOT on JVM (powered by Quarkus 2.3.1.Final) started in 1.035s. Listening on: http://0.0.0.0:80802021-10-21 20:40:54,049 INFO [io.quarkus] (main) optaplanner-quickstart 1.0.0-SNAPSHOT on JVM (powered by Quarkus 2.3.1.Final) started in 1.035s. Listening on: http://0.0.0.0:80802021-10-21 20:40:54,060 INFO [io.quarkus] (main) Profile prod activated.2021-10-21 20:40:54,061 INFO [io.quarkus] (main) Installed features: [cdi, optaplanner, optaplanner-jackson, resteasy, resteasy-jackson, smallrye-context-propagation, vertx]2021-10-21 20:41:03,525 INFO [org.opt.cor.imp.sol.DefaultSolver] (pool-6-thread-1) Solving started: time spent (172), best score (-597init/0hard/0soft), environment mode (REPRODUCIBLE), move thread count (96), random (JDK with seed 0).2021-10-21 20:41:04,189 ERROR [org.opt.cor.imp.sol.DefaultSolverManager] (pool-6-thread-1) Solving failed for problemId (1).: java.lang.IllegalStateException: The move thread with moveThreadIndex (24) has thrown an exception. Relayed here in the parent thread. at org.optaplanner.core.impl.heuristic.thread.OrderByMoveIndexBlockingQueue.take(OrderByMoveIndexBlockingQueue.java:147) at org.optaplanner.core.impl.constructionheuristic.decider.MultiThreadedConstructionHeuristicDecider.forageResult(MultiThreadedConstructionHeuristicDecider.java:187) at org.optaplanner.core.impl.constructionheuristic.decider.MultiThreadedConstructionHeuristicDecider.decideNextStep(MultiThreadedConstructionHeuristicDecider.java:158) at org.optaplanner.core.impl.constructionheuristic.DefaultConstructionHeuristicPhase.solve(DefaultConstructionHeuristicPhase.java:75) at org.optaplanner.core.impl.solver.AbstractSolver.runPhases(AbstractSolver.java:99) at org.optaplanner.core.impl.solver.DefaultSolver.solve(DefaultSolver.java:175) at org.optaplanner.core.impl.solver.DefaultSolverJob.call(DefaultSolverJob.java:101) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:830)Caused by: java.lang.ClassCastException: class org.acme.Timeslot cannot be cast to class org.acme.WaveMeeting (org.acme.Timeslot and org.acme.WaveMeeting are in unnamed module of loader io.quarkus.bootstrap.runner.RunnerClassLoader @77a567e1) at org.optaplanner.core.api.score.stream.ConstraintCollectors.lambda$toList$159(ConstraintCollectors.java:1509) at org.optaplanner.core.impl.score.stream.drools.common.BiAccumulator.accumulate(BiAccumulator.java:57) at org.drools.core.rule.SingleAccumulate.accumulate(SingleAccumulate.java:96) at org.drools.modelcompiler.constraints.LambdaGroupByAccumulate.accumulate(LambdaGroupByAccumulate.java:121) at org.drools.modelcompiler.constraints.LambdaGroupByAccumulate.accumulate(LambdaGroupByAccumulate.java:114) at org.drools.core.phreak.PhreakAccumulateNode.addMatch(PhreakAccumulateNode.java:736) at org.drools.core.phreak.PhreakAccumulateNode.doRightInserts(PhreakAccumulateNode.java:253) at org.drools.core.phreak.PhreakAccumulateNode.doNode(PhreakAccumulateNode.java:99) at org.drools.core.phreak.RuleNetworkEvaluator.switchOnDoBetaNode(RuleNetworkEvaluator.java:586) at org.drools.core.phreak.RuleNetworkEvaluator.evalBetaNode(RuleNetworkEvaluator.java:555) at org.drools.core.phreak.RuleNetworkEvaluator.evalNode(RuleNetworkEvaluator.java:382) at org.drools.core.phreak.RuleNetworkEvaluator.innerEval(RuleNetworkEvaluator.java:342) at org.drools.core.phreak.RuleNetworkEvaluator.evalStackEntry(RuleNetworkEvaluator.java:240) at org.drools.core.phreak.RuleNetworkEvaluator.outerEval(RuleNetworkEvaluator.java:183) at org.drools.core.phreak.RuleNetworkEvaluator.evaluateNetwork(RuleNetworkEvaluator.java:136) at org.drools.core.phreak.RuleExecutor.reEvaluateNetwork(RuleExecutor.java:235) at org.drools.core.phreak.RuleExecutor.evaluateNetworkAndFire(RuleExecutor.java:91) at org.drools.core.concurrent.AbstractRuleEvaluator.internalEvaluateAndFire(AbstractRuleEvaluator.java:33) at org.drools.core.concurrent.SequentialRuleEvaluator.evaluateAndFire(SequentialRuleEvaluator.java:43) at org.drools.core.common.DefaultAgenda.fireLoop(DefaultAgenda.java:869) at org.drools.core.common.DefaultAgenda.internalFireAllRules(DefaultAgenda.java:816) at org.drools.core.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:808) at org.drools.core.impl.StatefulKnowledgeSessionImpl.internalFireAllRules(StatefulKnowledgeSessionImpl.java:1343) at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1334) at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1326) at org.optaplanner.core.impl.score.director.stream.DroolsConstraintStreamScoreDirector.calculateScore(DroolsConstraintStreamScoreDirector.java:90) at org.optaplanner.core.impl.score.director.AbstractScoreDirector.doAndProcessMove(AbstractScoreDirector.java:220) at org.optaplanner.core.impl.heuristic.thread.MoveThreadRunner.run(MoveThreadRunner.java:147) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ... 4 more
2021-10-21 20:41:04,205 ERROR [io.qua.ver.htt.run.QuarkusErrorHandler] (executor-thread-0) HTTP Request to /hello failed, error id: 31388394-6985-4eeb-8f5a-e93591c907a4-1: org.jboss.resteasy.spi.UnhandledException: java.lang.IllegalStateException: Solving failed. at org.jboss.resteasy.core.ExceptionHandler.handleApplicationException(ExceptionHandler.java:106) at org.jboss.resteasy.core.ExceptionHandler.handleException(ExceptionHandler.java:372) at org.jboss.resteasy.core.SynchronousDispatcher.writeException(SynchronousDispatcher.java:218) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:519) at org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:261) at org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:161) at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:364) at org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:164) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:247) at io.quarkus.resteasy.runtime.standalone.RequestDispatcher.service(RequestDispatcher.java:73) at io.quarkus.resteasy.runtime.standalone.VertxRequestHandler.dispatch(VertxRequestHandler.java:135) at io.quarkus.resteasy.runtime.standalone.VertxRequestHandler$1.run(VertxRequestHandler.java:90) at io.quarkus.vertx.core.runtime.VertxCoreRecorder$13.runWith(VertxCoreRecorder.java:543) at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478) at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29) at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.base/java.lang.Thread.run(Thread.java:830)Caused by: java.lang.IllegalStateException: Solving failed. at org.acme.GreetingResource.test(GreetingResource.java:35) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:567) at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:170) at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:130) at org.jboss.resteasy.core.ResourceMethodInvoker.internalInvokeOnTarget(ResourceMethodInvoker.java:660) at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTargetAfterFilter(ResourceMethodInvoker.java:524) at org.jboss.resteasy.core.ResourceMethodInvoker.lambda$invokeOnTarget$2(ResourceMethodInvoker.java:474) at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:364) at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:476) at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:434) at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:408) at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:69) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:492) ... 15 moreCaused by: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Solving failed for problemId (1). at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191) at org.optaplanner.core.impl.solver.DefaultSolverJob.getFinalBestSolution(DefaultSolverJob.java:162) at org.acme.GreetingResource.test(GreetingResource.java:33) ... 30 moreCaused by: java.lang.IllegalStateException: Solving failed for problemId (1). at org.optaplanner.core.impl.solver.DefaultSolverJob.call(DefaultSolverJob.java:109) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ... 1 moreCaused by: java.lang.IllegalStateException: The move thread with moveThreadIndex (24) has thrown an exception. Relayed here in the parent thread. at org.optaplanner.core.impl.heuristic.thread.OrderByMoveIndexBlockingQueue.take(OrderByMoveIndexBlockingQueue.java:147) at org.optaplanner.core.impl.constructionheuristic.decider.MultiThreadedConstructionHeuristicDecider.forageResult(MultiThreadedConstructionHeuristicDecider.java:187) at org.optaplanner.core.impl.constructionheuristic.decider.MultiThreadedConstructionHeuristicDecider.decideNextStep(MultiThreadedConstructionHeuristicDecider.java:158) at org.optaplanner.core.impl.constructionheuristic.DefaultConstructionHeuristicPhase.solve(DefaultConstructionHeuristicPhase.java:75) at org.optaplanner.core.impl.solver.AbstractSolver.runPhases(AbstractSolver.java:99) at org.optaplanner.core.impl.solver.DefaultSolver.solve(DefaultSolver.java:175) at org.optaplanner.core.impl.solver.DefaultSolverJob.call(DefaultSolverJob.java:101) ... 4 moreCaused by: java.lang.ClassCastException: class org.acme.Timeslot cannot be cast to class org.acme.WaveMeeting (org.acme.Timeslot and org.acme.WaveMeeting are in unnamed module of loader io.quarkus.bootstrap.runner.RunnerClassLoader @77a567e1) at org.optaplanner.core.api.score.stream.ConstraintCollectors.lambda$toList$159(ConstraintCollectors.java:1509) at org.optaplanner.core.impl.score.stream.drools.common.BiAccumulator.accumulate(BiAccumulator.java:57) at org.drools.core.rule.SingleAccumulate.accumulate(SingleAccumulate.java:96) at org.drools.modelcompiler.constraints.LambdaGroupByAccumulate.accumulate(LambdaGroupByAccumulate.java:121) at org.drools.modelcompiler.constraints.LambdaGroupByAccumulate.accumulate(LambdaGroupByAccumulate.java:114) at org.drools.core.phreak.PhreakAccumulateNode.addMatch(PhreakAccumulateNode.java:736) at org.drools.core.phreak.PhreakAccumulateNode.doRightInserts(PhreakAccumulateNode.java:253) at org.drools.core.phreak.PhreakAccumulateNode.doNode(PhreakAccumulateNode.java:99) at org.drools.core.phreak.RuleNetworkEvaluator.switchOnDoBetaNode(RuleNetworkEvaluator.java:586) at org.drools.core.phreak.RuleNetworkEvaluator.evalBetaNode(RuleNetworkEvaluator.java:555) at org.drools.core.phreak.RuleNetworkEvaluator.evalNode(RuleNetworkEvaluator.java:382) at org.drools.core.phreak.RuleNetworkEvaluator.innerEval(RuleNetworkEvaluator.java:342) at org.drools.core.phreak.RuleNetworkEvaluator.evalStackEntry(RuleNetworkEvaluator.java:240) at org.drools.core.phreak.RuleNetworkEvaluator.outerEval(RuleNetworkEvaluator.java:183) at org.drools.core.phreak.RuleNetworkEvaluator.evaluateNetwork(RuleNetworkEvaluator.java:136) at org.drools.core.phreak.RuleExecutor.reEvaluateNetwork(RuleExecutor.java:235) at org.drools.core.phreak.RuleExecutor.evaluateNetworkAndFire(RuleExecutor.java:91) at org.drools.core.concurrent.AbstractRuleEvaluator.internalEvaluateAndFire(AbstractRuleEvaluator.java:33) at org.drools.core.concurrent.SequentialRuleEvaluator.evaluateAndFire(SequentialRuleEvaluator.java:43) at org.drools.core.common.DefaultAgenda.fireLoop(DefaultAgenda.java:869) at org.drools.core.common.DefaultAgenda.internalFireAllRules(DefaultAgenda.java:816) at org.drools.core.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:808) at org.drools.core.impl.StatefulKnowledgeSessionImpl.internalFireAllRules(StatefulKnowledgeSessionImpl.java:1343) at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1334) at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1326) at org.optaplanner.core.impl.score.director.stream.DroolsConstraintStreamScoreDirector.calculateScore(DroolsConstraintStreamScoreDirector.java:90) at org.optaplanner.core.impl.score.director.AbstractScoreDirector.doAndProcessMove(AbstractScoreDirector.java:220) at org.optaplanner.core.impl.heuristic.thread.MoveThreadRunner.run(MoveThreadRunner.java:147) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ... 4 more
- incorporates
-
PLANNER-2518 NullPointerException under load
- Resolved
- is duplicated by
-
PLANNER-2565 ClassCastException in complex constraint with groupBy() and flattenLast()
- Closed
- is triggering
-
DROOLS-6705 Make innerDeclarations available during Accumulator init(...)
- Open