tkobayas commented on code in PR #6341:
URL: 
https://github.com/apache/incubator-kie-drools/pull/6341#discussion_r2086114159


##########
drools-reliability/drools-reliability-core/src/main/java/org/drools/reliability/core/ReliableSessionInitializer.java:
##########
@@ -85,8 +85,8 @@ public InternalWorkingMemory init(InternalWorkingMemory 
session, PersistedSessio
         }
 
         private void onWorkingMemoryAction(InternalWorkingMemory session, 
PropagationEntry entry) {
-            if (entry instanceof PropagationEntry.Insert) {
-                InternalFactHandle fh = ((PropagationEntry.Insert) 
entry).getHandle();
+            if (entry instanceof PropagationEntry.Insert || entry instanceof 
PropagationEntry.Update) {
+                InternalFactHandle fh = 
((PropagationEntry.AbstractPropagationEntry) entry).getHandle();

Review Comment:
   `SimpleStoreRuntimeEventListener.objectUpdated` stores the updated object as 
"propagated = false" -> 
https://github.com/apache/incubator-kie-drools/blob/10.0.0/drools-reliability/drools-reliability-core/src/main/java/org/drools/reliability/core/ReliableSessionInitializer.java#L127
 
   
   It helps in the case:
   
   -  `ksession.update` -> JVM crashes -> restore the session (= the 
non-propagated objects are inserted) -> fireAllRules -> fire! (GOOD)
   
   , but it cause a problem in this case:
   
   - `update` in RHS, so the updated objects are evaluated and rules are fired. 
 -> but `propagated` remains false -> JVM crashes -> restore the session (= the 
non-propagated objects are inserted) -> fireAllRules -> the same rules are 
fired again (BAD)
   
    So the fix is to stores the updated object as "propagated = true" when 
propagated.  (not only inserted pbjects)



-- 
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