fix: improve error handling for retryable operations#2342
Merged
eddycharly merged 4 commits intoDec 15, 2025
Conversation
This change adds retry logic for handling transient errors in Kubernetes operations (update, create, and patch). It properly retries operations when encountering conflict errors, server timeouts, too many requests, and service unavailability errors. Non-retryable errors are properly propagated. Tests are added to verify the retry behavior. Signed-off-by: Karthik babu Manam <[email protected]>
karthikmanam
force-pushed
the
fix/improve-retryable-errors
branch
from
April 1, 2025 10:16
2152fb7 to
f45c235
Compare
eddycharly
enabled auto-merge (squash)
December 15, 2025 13:43
eddycharly
approved these changes
Dec 15, 2025
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2342 +/- ##
============================
============================
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Explanation
This PR improves error handling in the create, update, and patch operations by implementing proper retry logic for transient errors. Previously, the code had TODO comments indicating the need to determine which errors could be retried. This PR addresses these TODOs by implementing specific logic to identify and handle retryable errors like conflicts, server timeouts, too many requests, and service unavailability.
Additionally, the create operation has been simplified to directly check for the AlreadyExists error from the API server instead of making a separate Get request followed by a Create request.
Related issue
This PR addresses TODO comments found in the code that were highlighting the need for better error handling in the Kubernetes resource operations. It improves the reliability of the application when interacting with Kubernetes API server under load or unstable network conditions.
Proposed Changes
Checklist
Signed-off-by: Karthik babu Manam [email protected]