CAMEL-24583: camel-master - do not start the delegated consumer after leadership is lost (CAMEL-24584) - #26052
Conversation
… leadership is lost (CAMEL-24584) MasterConsumer started the delegated consumer from a BackgroundTask scheduled after the leadership-taken event. A leadership-lost event arriving during that window was dropped because delegatedConsumer was still null, leaving the consumer running on a non-leader node. Leadership is now tracked under the consumer lock; the scheduled task re-checks it before starting, the lost event is dispatched unconditionally to cancel a pending start, the delegate is created off the lock and published only if leadership still holds, and delegatedConsumer is published only after a successful start. backOffMaxAttempts now correctly bounds the attempts. Also fixes CAMEL-24584: BackgroundTask.schedule now cancels its repeating schedule once the task has completed or run out of budget, instead of re-running as a no-op for the life of the executor. Closes #26028 (cherry picked from commit f899b39)
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
|
🧪 CI tested the following changed modules:
🔬 Scalpel shadow comparison — Scalpel: 556 tested, 28 compile-only — current: 555 all testedMaveniverse Scalpel detected 584 affected modules (current approach: 555).
|
Backport of #26028 to
camel-4.22.x.Cherry-pick of the squashed commit f899b39 from
main. The only non-mechanical change is the upgrade-guide note, which was moved fromcamel-4x-upgrade-guide-4_23.adoc(which does not exist on this branch) intocamel-4x-upgrade-guide-4_22.adoc. Code and tests are identical to the original.Original PR: #26028
Summary
backOffMaxAttemptsnow correctly bounds the start attempts.BackgroundTask.schedulecancels its repeating schedule once the task has completed or run out of budget, instead of re-running as a no-op for the life of the executor.Claude Code on behalf of davsclaus