yesamer commented on code in PR #6707:
URL: 
https://github.com/apache/incubator-kie-drools/pull/6707#discussion_r3305084503


##########
drools-core/src/main/java/org/drools/core/phreak/RuleExecutor.java:
##########
@@ -311,7 +311,9 @@ public void removeDormantTuple(RuleTerminalNodeLeftTuple 
tuple) {
                 throw new IllegalStateException();
             }
         }
-        dormantMatches.remove(tuple);
+        if (tuple.getPrevious() != null || dormantMatches.getFirst() == tuple) 
{
+            dormantMatches.remove(tuple);
+        }

Review Comment:
   @Rikkola Thank you, I guess I understood that. A couple of questions:
   - In which conditions those orphan tuples appear? Should investigate how to 
prevent that or it is somehow expected?
   - It is safe to have those orphan in memory? Your fix doesn't remove it from 
the involevd linked list, but it will contain to stay in memory, I guess. 
Should we consider to remove that tuple? 
   
   Apologies if I'm so picky, I'm just asking to learn more :)



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