-
Bug
-
Resolution: Done
-
Major
-
7.73.0.Final, 8.38.0.Final
-
None
-
2023 Week 18-20 (from May 1), 2023 Week 21-23 (from May 22)
-
NEW
-
NEW
-
---
-
---
We have an issue where stateful session completely stops working after upgrading a rule with minor changes which should not affect behaviour at all.
In this case, just removing an unused import from .drl makes the rule stop triggering, even though precondition facts are present.
I read that if there is a runtime exception in LHS, rule engine can become corrupted. It behaves like that, even though there are no exceptions at all, so we cannot catch anything and revert. This makes modifying rules during system operation very unpredictive - same rule should behave the same during initial load and after every upgrade that didn't change it.
Reproducer test case is attached.
Problematic drl: testRuleUpgradeInvalid.drl
Test case only removes the 9th line (unused import statement) and after the knowledge base upgrade to a new version, expected InstrumentState=NOMINAL fact is missing.
This can be mitigated by modifying the "invalid" drl in one of the following ways:
- replacing the root OR for MAINTENANCE rule with two rules instead: testRuleUpgradeValidNoOr.drl
- I read that Drools internally convert root or clauses into multiple rules, however this gives me no logical answer why this happens
- inserting exists clause before composite OR condition in MAINTENANCE rule: testRuleUpgradeValidExists.drl
- this whole condition tree in maintenance rule is not satisfied by currently inserted facts so it should not affect the NOMINAL rule firing, whether it is written with or without exists keyword
- adding a "members" variable declaration in STOPPED rule: testRuleUpgradeValidVarDeclaration.drl
- members variable is not used at all in whole drl so it should not affect operation, but it does
Expected operation should be consistent regardless if rule engine is upgraded or just initialized once with the same rules, or throw an error if there is one in DRL.
- is duplicated by
-
DROOLS-7462 Sporadic class cast exception during stateful session updating
- Resolved