allthingssecurity commented on PR #29532:
URL: https://github.com/apache/camel/pull/29532#issuecomment-6763064486

   Thanks for the review. Follow-up commit d85a0e7bcc9c.
   
   - Dropped future: `stopLeadership(false)` now keeps the future until the 
thread is done, and the stop of the policy (or `onRemove` while the 
CamelContext stops) cancels it with an interrupt, like the current one. One 
limit: on a Hazelcast member `tryLock` does not end on an interrupt, only after 
its timeout, so this helps on a client, where the wait ends at once. New test 
`stopAfterTheRouteWasRemovedDoesNotWaitForTheLock` uses a follower on a client 
whose route is removed while it waits for the lock. Its CamelContext stop took 
30 s before the change (the pool's await termination set in the test) and is 
quick now.
   - Stop/start test: added `restartedNodeCompetesForTheLeadershipAgain`. The 
leader's CamelContext is stopped and started again, and the node must take over 
once the other node stops. It already passed before this commit, because the 
routes go through `onInit` again on the restart, so it is a guard for that path.
   - `MasterRoutePolicy` in camel-zookeeper-master: agreed, it has no 
`onRemove` (and no `onStart`/`onResume`) either. A follow-up JIRA will be filed 
for it.
   - `doStart` and the lock: `doStart` and `doStop` already run under the 
policy lock. `RoutePolicySupport` uses `BaseService`'s `lock`, which `start()` 
and `stop()` hold around them. So I fixed the comments rather than adding a 
second lock there.
   - `route` for JMX: after a removal it now points at a route that still uses 
the policy, or is null when none is left. The getters read the field once. 
`policySharedByTwoRoutesKeepsTheLeadershipUntilBothAreRemoved` checks the route 
id.
   
   `HazelcastRoutePolicyRouteLifecycleTest`: 9 tests, 90/90 over 10 runs in one 
JVM.
   
   _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]

Reply via email to