allthingssecurity commented on PR #26862: URL: https://github.com/apache/camel/pull/26862#issuecomment-5855362391
Checked this against #26861 (CAMEL-25003), which also changes `ServicePool`. The two merge cleanly (`git merge-tree`), and they don't interact: this PR only changes the singleton path (`SinglePool.cleanupEvicts`), and #26861 only changes the non-singleton path (`MultiplePool` and the non-singleton branch of `onEvict`). `ProducerCacheEvictEndpointInUseTest` uses `seda:` (singleton), and `ProducerCacheNonSingletonEvictionTest` in #26861 uses a non-singleton endpoint only, so both sets of tests should still hold once both are merged (from reading the code, not run). Two small things: - `ServicePool.java:190-197`: `isEndpointInUse` was inserted between the `/** Stops the service safely */` Javadoc and `stop(S)`, so that Javadoc now sits above the new method's Javadoc and `stop(S)` has none. - Not blocking, and not new (before this PR the endpoint was always stopped): `isEndpointInUse` only treats the static registry and route consumers as "in use". A dynamic endpoint can also be held by another producer cache: each `toD`/`recipientList`/`routingSlip` has its own `DefaultProducerCache` (`SendDynamicProcessor.java:419`), and so does every `ProducerTemplate`. If two `toD`s resolve the same URI they share the `Endpoint` instance, so evicting it from one cache stops the endpoint while the other cache still holds a started producer for it. Could be a follow-up. _Claude Code on behalf of allthingssecurity_ -- 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]
