fix: clear stale FailedNodes entry when a node recovers - #333
fix: clear stale FailedNodes entry when a node recovers#333bhuvan-somisetty wants to merge 1 commit into
Conversation
processNodeAgainstAllRules (NodeReconciler path) only recorded FailedNodes on evaluation error and never cleared it on success, so a node that later passed evaluation stayed listed in rule.Status.FailedNodes indefinitely. Add clearNodeFailure and call it on the success path, mirroring the recordNodeFailure/clearNodeFailure pattern already used in processAllNodesForRule. Signed-off-by: bhuvan-somisetty <somisettybhuvan5@gmail.com>
✅ Deploy Preview for node-readiness-controller canceled.
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: bhuvan-somisetty 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 |
|
Hi @bhuvan-somisetty. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
|
/assign @ajaysundark |
|
/ok-to-test |
|
Thanks for the ok-to-test, @ajaysundark! All the Prow jobs (test, e2e, verify-all) are green now. Whenever you get a chance to take a look, let me know if you'd like anything changed. |
|
/cc @vitorfloriano @Priyankasaggu11929 do either of you have time for this scenario review? |
I'll take a look at it, and post some comments by tomorrow EOD. |
|
or wait, I see PR #209 landed first and @bhuvan-somisetty - you have already dropped some review comments around it here #332 (comment) IIUC (from just PR titles and from the code changes as well), both these PRs are supposed to be fixing the same problem. Let's try to get #209 merged. |
|
Makes sense, #209 already covers this exact fix along with the data race one. Closing this in favor of that. Thanks for checking! |
|
Thanks for your PR. Let's track the fix in the current open PR #381 |
Description
This is a follow-up to #332, extracted per @ajaysundark's request to review #209 and evaluate the
recordFailure/staleFailedNodespatch separately from the ruleCache data-race fix.processNodeAgainstAllRules(theNodeReconcilerpath innode_controller.go) records aNodeFailureviarecordNodeFailurewhenevaluateRuleForNodeerrors, but never clears it when the node later evaluates successfully. Sincerulehere is a deep-copied snapshot carried over fromruleCache(per #332), a stale failure entry from a prior reconcile keeps getting copied forward intorule.Status.FailedNodeson every subsequent successful evaluation, so a recovered node is stuck listed as failed indefinitely.nodereadinessrule_controller.go'sprocessAllNodesForRule(theRuleReconcilerpath) already clearsFailedNodesinline on the success branch, so it isn't affected — only theNodeReconcilerpath needed the fix.This adds a
clearNodeFailurehelper (matching the existingrecordNodeFailurepattern) and calls it on the success branch ofprocessNodeAgainstAllRules.Related
Follow-up to #332, evaluated from #209.
Type of Change
/kind bug
Testing
go build ./...go vet ./...go test ./internal/controller/...golangci-lint run ./internal/controller/...TestClearNodeFailureandTestRecordThenClearNodeFailurecovering the helper directly.Checklist
make testpassesmake lintpassesDoes this PR introduce a user-facing change?