[
https://issues.jboss.org/browse/JBRULES-2045?page=com.atlassian.jira.plug...
]
Hao Chen commented on JBRULES-2045:
-----------------------------------
Core Drools bugs are killing us on production. This defect happens on conditions like: a
and (b or c)
We just ran into a huge memory issue that freezes the JVM completely (we cannot even take
thread dumps), which seems to happen on long conditions like: (not a) and (not b) and (not
c) and (not d) and (not e) and (not f). We are trying to make a simple test case for that.
At the same time, what can we do to get Drools project to fix such issues as soon as
possible? Please let us know! It doesn't make sense to expand to new features if the
core rules engine is not working correctly.
Rules Fact Error In Complex Condition Structure
-----------------------------------------------
Key: JBRULES-2045
URL:
https://issues.jboss.org/browse/JBRULES-2045
Project: Drools
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: drools-core
Affects Versions: 4.0.6
Reporter: Hao Chen
Assignee: Mark Proctor
Fix For: 5.4.0.CR1
Attachments: test.zip
We are running into a complex production rule that either doesn't work or generate
errors. I debugged and it seems Drools is not using the correct fact for some segments of
the rule conditions. Steps to reproduce
1. Build the attached test case
2. Run the DroolsDefectTest junit test, it should print value "Worked!" on the
output console.
3. Modify the rule by remove the commented condition that uses variable b2.
4. Run the test again.
Expected result: the rule should output "Worked!" again.
Actual result: failed with error:
org.drools.RuntimeDroolsException: org.drools.test.Rule_test_0Eval4Invoker@68f1f17a :
java.lang.NumberFormatException: For input string: "Y"
at org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:82)
at org.drools.reteoo.EvalConditionNode.assertTuple(EvalConditionNode.java:148)
at
org.drools.reteoo.SingleTupleSinkAdapter.propagateAssertTuple(SingleTupleSinkAdapter.java:20)
at org.drools.reteoo.JoinNode.assertObject(JoinNode.java:156)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:318)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:145)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:299)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:162)
at org.drools.reteoo.Rete.assertObject(Rete.java:175)
at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:192)
at org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:71)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:915)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:887)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:688)
at com.firstbest.rules.DroolsDefectTest.test_drools(DroolsDefectTest.java:35)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: java.lang.NumberFormatException: For input string: "Y"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.valueOf(Unknown Source)
at com.firstbest.rules.Field.intValue(Field.java:29)
at org.drools.test.Rule_test_0.eval4(Rule_test_0.java:32)
at org.drools.test.Rule_test_0Eval4Invoker.evaluate(Rule_test_0Eval4Invoker.java:20)
at org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:77)
... 32 more
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira