Skip to content

Conversation

@LikiosSedo
Copy link
Contributor

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() with retry.RetryOnConflict():

  • Retry up to 10 times with exponential backoff
  • Each retry fetches the latest resource version before updating
  • Only log genuine system errors, not expected conflicts

Changes

Modified 2 controllers to add retry mechanism for status updates:

  • internal/controller/arksapplication_controller.go
  • internal/controller/arksdisaggregatedapplication_controller.go

Impact

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.

…on and ArksDisaggregatedApplication

Wraps Status().Update() calls with retry.RetryOnConflict() to handle concurrent modifications during reconciliation. This prevents 'the object has been modified' errors when users modify resources while the controller is updating status.

Controllers fixed:
- ArksDisaggregatedApplication: Confirmed production issue with frequent Prefill/Decode tuning
- ArksApplication: Same vulnerability pattern with frequent replica/config changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant