allthingssecurity commented on PR #28639: URL: https://github.com/apache/camel/pull/28639#issuecomment-6489352400
@davsclaus thanks for the review. The nit is fixed in dca9d854a876 (one new commit on top): `stop()` and `shutdown()` now check for consumers and suspended consumers under the endpoint's service lock, the one `onStarted`/`onSuspended`/`onStopped` take, so a consumer that starts concurrently is either seen by the check or registers after the stop. The lock is reentrant, so `super.stop()`/`super.shutdown()` take it again as before, and no new lock order comes in (they already held it around `doStop`/`doShutdown`). Test: `consumerRegisteringWhileTheEndpointIsAskedToStopKeepsTheEndpointStarted` holds the lock as a registering consumer does, lets another thread call `stop()` until it is queued on the lock, then registers a consumer. With the old check outside the lock it fails (the endpoint stops); no sleep. camel-disruptor: 122 tests, 0 failures; the test class passed 20 runs in one JVM. No open follow-ups. _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]
