mdproctor opened a new issue, #6715:
URL: https://github.com/apache/incubator-kie-drools/issues/6715

   ## Summary
   
   `ReteCompiledEngine.adapters` accumulates `ContextRouterAdapter` 
subscriptions in an `IdentityHashMap` on the shared compiled engine. When 
`disposeUnit()` is called, the unit context is removed from the Router 
(correct) but the `ContextRouterAdapter` remains subscribed to the 
`PropagatingDataStore` indefinitely.
   
   ## Impact
   
   - After all units for a given DataStore are disposed, events still flow 
through the adapter into the Router (no-op since contextCount == 0), wasting 
CPU.
   - If units are created and disposed repeatedly, adapter subscriptions 
accumulate.
   
   ## Fix approach
   
   Add a reference-count per adapter entry. On `disposeUnit()`, decrement the 
count; when it reaches zero, call `pds.unsubscribe(adapter)` and remove from 
the map.
   
   Refs #6712


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