fix: Add retry mechanism for status update conflicts in ArksApplicati… #64
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes resource version conflict errors when updating CRD status in high-frequency operation scenarios.
Problem
When users frequently modify Arks resources, the controller logs version conflict errors:
E1029 12:48:01.420297 failed to update status:
"Operation cannot be fulfilled on arksapplications.arks.ai:
the object has been modified; please apply your changes to
the latest version and try again"
Root cause: During controller reconcile (100-500ms), user modifications increment resourceVersion, causing status update with outdated version to fail.
Solution
Wrap
Status().Update()withretry.RetryOnConflict():Changes
Modified 2 controllers to add retry mechanism for status updates:
internal/controller/arksapplication_controller.gointernal/controller/arksdisaggregatedapplication_controller.goImpact
Before: ERROR logs with version conflicts, status updates fail and require automatic requeue
After: Silent automatic retry on conflicts, status updates succeed, no ERROR logs for expected conflicts
Compatibility
No breaking changes, compatible with existing deployments.