Rikkola commented on code in PR #6584:
URL:
https://github.com/apache/incubator-kie-drools/pull/6584#discussion_r2774142412
##########
drools-core/src/main/java/org/drools/core/reteoo/CompositeLeftTupleSinkAdapter.java:
##########
@@ -40,7 +40,18 @@ public CompositeLeftTupleSinkAdapter(final
RuleBasePartitionId partitionId) {
}
public void addTupleSink(final LeftTupleSink sink) {
- this.sinks.add( (LeftTupleSinkNode) sink );
+ // Prevent duplicate BiLinear shared nodes to avoid RETE corruption
+ LeftTupleSinkNode sinkNode = (LeftTupleSinkNode) sink;
+
+ // Check if this exact sink instance is already registered
+ for (LeftTupleSinkNode existing = this.sinks.getFirst(); existing !=
null; existing = existing.getNextLeftTupleSinkNode()) {
+ if (existing == sinkNode) {
+ // Duplicate BiLinear shared node - skip to prevent corruption
+ return;
+ }
+ }
+
+ this.sinks.add( sinkNode );
sinkArray = null;
Review Comment:
No fix needed.
--
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]