🐛 controller: cap BareMetalHost reconcile backoff at 30 seconds#3163
🐛 controller: cap BareMetalHost reconcile backoff at 30 seconds#3163MahnoorAsghar wants to merge 1 commit intometal3-io:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
The default controller-runtime exponential rate limiter has a maximum delay of 1000 seconds (~16 minutes). During BMO startup there is a brief race between the reconcile loop becoming active and BMO's own validating-webhook Service endpoint being propagated: any BareMetalHost reconciliation that triggers a webhook call in that window gets a "no endpoints available" error. A burst of such errors is enough to drive the per-item exponential backoff to its ceiling, after which BMO silently waits up to 16 minutes before attempting the next reconcile even though the webhook has long since become reachable. Replace the default rate limiter with one that is otherwise identical but caps the per-item exponential delay at 30 seconds. This bounds the recovery window to at most one retry interval after the endpoint is propagated, matching the behaviour of other Metal3 controllers. Generated-by: Cursor, claude-4.6-sonnet-medium model Signed-off-by: MahnoorAsghar <masghar@redhat.com>
b869383 to
56dfa5b
Compare
|
Is #3162 solving the same problem? Do we need both? |
|
@dtantsur They're both needed, AFAIU |
There was a problem hiding this comment.
Pull request overview
This PR adjusts the BareMetalHost controller’s reconcile rate limiting to avoid long per-item exponential backoffs after transient webhook endpoint propagation failures during BMO startup.
Changes:
- Replace the default controller-runtime rate limiter with a custom one that caps per-item exponential backoff at 30s (instead of ~1000s).
- Add the required imports and promote
golang.org/x/timeto a direct dependency.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| internal/controller/metal3.io/baremetalhost_controller.go | Introduces a custom typed workqueue rate limiter (exponential backoff capped at 30s + token bucket) via controller options. |
| go.mod | Adds golang.org/x/time as a direct requirement to support the token bucket limiter. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sunnatillo
left a comment
There was a problem hiding this comment.
Sorry, But I am not convinced this change is needed.
IMHO, the time between webhook ready and endoint available is not huge. Lets says 10s(probably way less). The exponential backoff never reaches 16 minutes that we are saying here.
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
What this PR does / why we need it:
The default controller-runtime exponential rate limiter has a maximum delay of 1000 seconds (~16 minutes). During BMO startup there is a brief race between the reconcile loop becoming active and BMO's own validating-webhook Service endpoint being propagated: any BareMetalHost reconciliation that triggers a webhook call in that window gets a "no endpoints available" error. A burst of such errors is enough to drive the per-item exponential backoff to its ceiling, after which BMO silently waits up to 16 minutes before attempting the next reconcile even though the webhook has long since become reachable.
Replace the default rate limiter with one that is otherwise identical but caps the per-item exponential delay at 30 seconds. This bounds the recovery window to at most one retry interval after the endpoint is propagated, matching the behaviour of other Metal3 controllers.
Generated-by: Cursor, claude-4.6-sonnet-medium model
Checklist: