Repository navigation
fix(server): Prevent Envoy retries of capacity rejections - #732
Merged
Merged
Conversation
Capacity rejections return 503 since #703. The Objectstore Envoy routes retry 503 under the gateway-error condition, so a saturated instance receives retries of its own rejections. Set x-envoy-ratelimited on rate limit and capacity rejections. Envoy does not retry responses with this header. Outlier detection still counts the 503. Co-Authored-By: Jan Michael Auer <jan.auer@sentry.io>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #732 +/- ##
=======================================
Coverage 91.90% 91.91%
=======================================
Files 117 117
Lines 24131 24141 +10
=======================================
+ Hits 22178 22189 +11
+ Misses 1953 1952 -1
☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Make LimitExceeded the single conversion for rate limit and capacity rejections. Its IntoResponse sets the status and x-envoy-ratelimited. The extractor rejection, web concurrency middleware, and service AtCapacity errors all delegate to it. Co-Authored-By: Jan Michael Auer <jan.auer@sentry.io>
jan-auer
approved these changes
Oct 23, 2026
lcian
approved these changes
Oct 23, 2026
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.
Since #703, capacity rejections return 503. Our Envoy routes retry on
gateway-error, which includes 503. As a result, a saturated instance gets retries of its own rejections.This PR sets
x-envoy-ratelimited: trueon rate limit and capacity rejections. Envoy does not retry a response that has this header. Real gateway errors are still retried, and outlier detection still counts the 503s.Ref FS-577, INC-2579
via async jauer.
--
View Junior Session [Sentry]