gnodet-bot commented on code in PR #30527: URL: https://github.com/apache/camel/pull/30527#discussion_r4651722139
########## docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc: ########## @@ -2302,6 +2302,31 @@ for the other changes. for. Before, it returned the replicas of its status, which lags behind until the pods are started or stopped, and failed with a `NullPointerException` when the deployment config had no status yet. +=== camel-kubernetes - a stopped cluster view gives up the leadership + +When a Kubernetes cluster view stops (its last user, such as a `master:` consumer or a clustered route, releases it, or +the cluster service stops), the view now reports that the pod is no longer the leader, tells its listeners, and, if the +leadership of the pod had taken effect, removes the pod from the lease (the `Lease`, or the leader key of the group in +the `ConfigMap`). Another pod then takes over the leadership on its next check, after the retry period. Before, the +stopped view kept reporting the pod as leader (`CamelClusterService.isLeader` returned `true`, also once the view was +used again, until its first lookup), and the lease kept naming the pod, so no other pod could lead the group until this +pod was no longer ready. A pod that is stopped while it waits to become the leader keeps the lease, as before. If the +lease cannot be updated, a WARN is logged and the lease is kept until the pod is no longer ready, as before. + +The stop of a view now waits for a check of the lease that is running and then for the release, both together up to +about the renew deadline (`renewDeadlineMillis`, 10 seconds by default); the Kubernetes client's own retries +(`requestRetryBackoffLimit`, 10 by default) do not make it longer, but the time the leadership listeners of the view +take when it stops counts against it. The views are stopped one after another: when the CamelContext stops, each +clustered route or `master:` consumer releases its view, which stops the view once no other route uses it, and then the +cluster service stops the rest. The views that stop while the CamelContext or the cluster service stops share one renew +deadline: the time each of them spends in its stop is taken from it (the time between their stops, such as the graceful +shutdown of the routes, is not), so with an API server that does not answer they wait up to about the renew deadline in +all, not once per group, and a view that stops after the time is used up does not try the release. A view that stops on Review Comment: 📝 **Docs readability: long sentences in second paragraph** The second paragraph of the upgrade guide entry has several sentences that are difficult to parse at a glance. The longest (starting "The views that stop while the CamelContext...") runs to ~83 words. Consider splitting it at the colons and semicolons — for example: > The views that stop while the CamelContext or the cluster service stops share one renew deadline. The time each view spends in its stop is counted against it (but not the time between stops, such as the graceful shutdown of routes). With an API server that does not answer, all views together wait up to about the renew deadline — not once per group. A view that stops after the time is used up does not try the release. The first paragraph is similarly dense (68-word opening sentence). Breaking these into shorter units would make the upgrade guide easier to scan. -- 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]
