OCPBUGS-100366: Re-queue ContainerRuntimeConfig on status update failure - #6415
OCPBUGS-100366: Re-queue ContainerRuntimeConfig on status update failure#6415nispriha wants to merge 1 commit into
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
Skipping CI for Draft Pull Request. |
|
@nispriha: This pull request references Jira Issue OCPBUGS-100366, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions 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 openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: nispriha 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 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan includes up to 2 reviews per rolling hour; 1 remains after this review. WalkthroughThe controller now propagates status update errors when the original sync succeeds. A regression test verifies that a 409 Conflict returned during status update causes ChangesStatus Error Propagation
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The change re-queues failed ContainerRuntimeConfig status updates, with no actionable merge-blocking risk remaining after normal checks and review. 🚥 Pre-merge checks | ✅ 14 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (14 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@nispriha: The following test failed, say
Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
|
/jira refresh |
|
@nispriha: This pull request references Jira Issue OCPBUGS-100366, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
DetailsIn response to this:
Instructions 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 openshift-eng/jira-lifecycle-plugin repository. |
| // If an error occurred in updating the status just log it | ||
| if statusUpdateErr != nil { | ||
| klog.Warningf("error updating container runtime config status: %v", statusUpdateErr) | ||
| if err == nil { |
There was a problem hiding this comment.
There are 2 other places in the same file where I see if statusUpdateErr != nil . Can you check if the fix is applicable to those code paths also?
|
|
||
| func (ctrl *Controller) syncStatusOnly(cfg *mcfgv1.ContainerRuntimeConfig, err error, args ...interface{}) error { | ||
| statusUpdateErr := retry.RetryOnConflict(updateBackoff, func() error { | ||
| newcfg, getErr := ctrl.mccrLister.Get(cfg.Name) |
There was a problem hiding this comment.
Can you try what happens if we do:
newcfg, getErr := ctrl.client.MachineconfigurationV1().ContainerRuntimeConfigs().Get(
context.TODO(), cfg.Name, metav1.GetOptions{})
That is get the data from API server rather than the internal cache. I may be wrong, but I'm thinking we might not get 409 error as its a new object from API server.
QiWang19
left a comment
There was a problem hiding this comment.
The fix makes sense to me. And I agree we can try to retrieve the objects from the API server instead of the mccrLister cache.
Fixes: OCPBUGS-100366
- What I did
During SNO bootstrap, the ContainerRuntimeConfig controller's
syncStatusOnlyfunction silently swallows status write failures. When the status write fails with a 409 Conflict (caused by a concurrent finalizer patch bumping theresourceVersion), the function logs a warning but returnsnil. The workqueue considers the item done and never re-queues it. The CR is left without.status(observedGeneration=0whilegeneration=1), causing the render controller to loop forever on:"status for ContainerRuntimeConfig enable-crun-master is being reported for 0, expecting it for 1".Fix: return
statusUpdateErrwhen the original sync error isnil, so the item is re-queued and the status write succeeds on the next sync (by which time the informer cache has caught up).- How to verify it
TestStatusUpdateConflictRequeues— injects a 409 Conflict onUpdateStatusand verifiessyncHandlerreturns an error (fails without the fix, passes with it)container-runtime-configtests pass (no regressions)oc patch ctrcfg <name> --type=merge --subresource=status -p '{"status":{"observedGeneration":0,"conditions":[]}}', verify the controller recovers- Description for the changelog
Fix ContainerRuntimeConfig controller silently swallowing status update failures, which could permanently block the render controller during SNO bootstrap.
Summary by CodeRabbit
Bug Fixes
Tests