Conflicts on update don't count as retry #98
Merged
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.
What type of PR is this?
/kind bug
What this PR does / why we need it:
When updating the resource quota,
e.checkAttributes
callse.checkQuotas
up to 3 times. This is to prevent transient failures when updating the resource quota object viae.quotaAccessor.UpdateQuotaStatus
. In case of an error, we calle.checkQuotas
again and we decrement the remaining retries.On busy clusters, we might exhaust the 3 retries before making a successful update, bubbling up the error to the client.
This PR is adding a check to avoid decrementing the retries when the error is because of a conflict. While this might increase the processing times because of the additional retries, there are two benefits:
If upstream doesn't like this approach, we might consider switching to a
workqueue.TypedRateLimitingInterface
so we can use a rate limiter before re-adding the object on the queue. This will required more code changes the requeue would happen at a higher level, so we need to be able to inspect thewaiter
to understand why it got denied.Which issue(s) this PR fixes:
Fixes kubernetes#67761
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: