Changes in rule evaluation in drools 10 in rules including non-dynamic objects #2109
Replies: 6 comments
-
|
@tkobayas would you also be able to take a look at this for a potential issue, or pass it on to somebody else? |
Beta Was this translation helpful? Give feedback.
-
|
Hello @daniel-clark-mint , I reproduced Then, I tried https://github.com/tkobayas/kiegroup-examples/blob/master/Ex-evaluation-10.1/src/test/java/com/sample/DroolsTest.java But it also evaluates twice (Output is Am I misunderstainding your description? |
Beta Was this translation helpful? Give feedback.
-
|
@tkobayas you understood correctly, maybe there is something different about how we our building our kiebase, I'll keep digging, thank you for looking into this! |
Beta Was this translation helpful? Give feedback.
-
|
FYI we also used your reproducer and it worked as expected, and the behavior is also as expected in our productive environment. So we have narrowed the issue down to our test framework, where each test is run on a different thread and enforces locks on various objects which are use to generate the input objects for the test executions. |
Beta Was this translation helpful? Give feedback.
-
Nothing specific comes to mind regarding changes in thread-safety between Drools 10 and pre-10. Do you share one ksession across mutiple threads? Anyway, ksession is thread-safe unless you explicitly disable it by ThreadSafeOption. |
Beta Was this translation helpful? Give feedback.
-
|
Seems to be related to proprietary framework and not drools. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all, I don't know if this is a defect or just a change in behavior we need to adapt for. This is the last (or second to last...) of the changes we have detected while preparing to upgrade from drools 7 to 10. We have approximately 3500 hand-written rules and 14000 unit test rules to test these in continuous integration, so I am confident we will turn up all "breaking changes" for our use cases.
When firing rules we fill the session with non-dynamic objects from our c++ application using the
org.kie.api.runtime.rule.EntryPoint.insert(Object object)function before calling FireAllRules on the same stateful kiesession.During the rule execution there are a lot of rules which insert objects via insertLogical. We have a lot of rules using the CountAccumulateFunction to inform logic based on the number of objects present, and based upon failing tests it seems some of these tests aren't re-evaluating as suspected (based on drools 7 behavior). I am including a reproducer below (I think it is too complicated but it took 3 days for me to get there from the original rules).
Most importantly for the reproducer:
Additionally:
existsinstead ofaccumulatethe rule doesn't seem to evaluate the second time even if the objects are inserted in the rule file.I assume something has changed around the linking of nodes in the memory path when non-dynamic objects are present and they aren't re-added to the stack - but despite debugging I haven't been able to identify the change in the stack.
I would be happy for advice on if we need to change a runtime compiler setting or just use a different insert method up front (these objects do not change during runtime), or if this is a bug.
Thank you for your assistance!
Reproducer:
Beta Was this translation helpful? Give feedback.
All reactions