feat(rate-limiting) add support for Retry-After header on 429 response #5329
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
This have been previously proposed with #3451 and #2735. This PR tries only to add
Retry-After
header, so it is not as complete as #3451, but it may be easier to get these in as parts.Thank you @grahamar and @ioggstream for all the previous efforts.
Details
The
Retry-After
is inseconds
. If there is more than oneLimit
configured and more than one limit has exceeded theRetry-After
will contain the biggest number (in seconds). E.g. if minute limit is exceeded and hour limit is exceeded it probably means thatRetry-After
will tell you when the hour limit is released assuming that the minute limit will be released earlier.The PR is also turning on most of the
unit test
suite onrate-limiting
.