davsclaus opened a new pull request, #25980: URL: https://github.com/apache/camel/pull/25980
## Backport of #25842 Cherry-pick of #25842 onto `camel-4.22.x`. **Original PR:** #25842 - CAMEL-24545: Camel Shutdown Locked State With ZookeeprCluster Service **Original author:** @mustafaAlmonayer **Target branch:** `camel-4.22.x` ### Original description During shutdown, Camel's ClusteredRoutePolicy.onRemove and the Curator leader selector thread both run concurrently because some routes keep the shutdown window open long enough. These two threads acquire the same two locks in opposite order, causing a classic deadlock that permanently hangs the JVM. See Jira ticket https://issues.apache.org/jira/projects/CAMEL/issues/CAMEL-24545 for Thread Dump and more details. This fix will result in the removal of possible DeadLock on shutting the application down where some routes with a large enough time window will result in a deadlock state and un-fire the unnecessary event where all the listeners will be removed so no need to send them the event on shutdown/stopping sense the view is being stopped. --- _Claude Code on behalf of davsclaus_ -- 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]
