tkobayas commented on code in PR #7220:
URL: https://github.com/apache/incubator-kie/pull/7220#discussion_r4356549017


##########
drools-core/src/main/java/org/drools/core/reteoo/PathMemory.java:
##########
@@ -62,6 +62,10 @@ protected boolean initDataDriven(ReteEvaluator 
reteEvaluator) {
     }
 
     protected boolean isRuleDataDriven(ReteEvaluator reteEvaluator, RuleImpl 
rule) {
+        // Data-driven evaluation in sequential mode causes NPE and incorrect 
results (incubator-kie#7209)
+        if (reteEvaluator != null && reteEvaluator.isSequential()) {
+            return false;
+        }
         return rule != null &&
                (rule.isDataDriven() || (reteEvaluator != null && 
reteEvaluator.getRuleSessionConfiguration()
                        .getForceEagerActivationFilter().accept(rule)));

Review Comment:
   This is intentional. `ForceEagerActivationFilter` is not related to the 
eager agenda (`addEagerRuleAgendaItem`, which is already a no-op in sequential 
mode). It only feeds `PathMemory.dataDriven`, so it triggers exactly the same 
data-driven path as `@Propagation(IMMEDIATE)` and would hit the same NPE / 
incorrect results with disabled tuple memory. So it must be disabled in 
sequential mode too.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to