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


##########
drools-core/src/main/java/org/drools/core/phreak/RuleExecutor.java:
##########
@@ -345,7 +345,8 @@ public void removeActiveTuple(RuleTerminalNodeLeftTuple 
tuple) {
         activeMatches.remove(tuple);
         if (tuple.getStagedType() != Tuple.DELETE) {
             addDormantTuple(tuple);
-        }
+        } // if Tuple.DELETE, it's not in activeMatches nor dormantMatches. 
Basically, unlinked from parent nodes, so will be GC'ed.
+          // Note: there could be a case where such a tuple will be retained 
and activated again. (e.g., accPropCtx.getResultLeftTuple())

Review Comment:
   Previously we were looking at this path as the "orphan path", but actually, 
this is intentional -- the tuple is unlinked, so no longer referenced by parent 
node's memory. So the tuple should not belong to activeMatches nor 
dormantMatches. Finally, will be GC'ed. So we could say it's "REMOVED" state, 
rather than "ORPHANED".
   
   However, as noted, there is a case where such a tuple is retained and 
activated again. So, not easy to frame the lifecycle.



##########
drools-core/src/main/java/org/drools/core/phreak/RuleExecutor.java:
##########
@@ -345,7 +345,8 @@ public void removeActiveTuple(RuleTerminalNodeLeftTuple 
tuple) {
         activeMatches.remove(tuple);
         if (tuple.getStagedType() != Tuple.DELETE) {
             addDormantTuple(tuple);
-        }
+        } // if Tuple.DELETE, it's not in activeMatches nor dormantMatches. 
Basically, unlinked from parent nodes, so will be GC'ed.
+          // Note: there could be a case where such a tuple will be retained 
and activated again. (e.g., accPropCtx.getResultLeftTuple())

Review Comment:
   Previously we were looking at this path as the "orphan path", but actually, 
this is intentional -- the tuple is unlinked, so no longer referenced by parent 
node's memory. So the tuple should not belong to activeMatches nor 
dormantMatches. Finally, will be GC'ed. So we could say it's "REMOVED" state, 
rather than "ORPHANED".
   
   However, as noted, there is a case where such a tuple is retained and 
activated again. So, it's not easy to frame the lifecycle.



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