Return correct Retry After Header value#33
Merged
sven-rosenzweig merged 4 commits intomasterfrom Jul 25, 2025
Merged
Conversation
d581af1 to
184ab4d
Compare
mutax
reviewed
Jul 23, 2025
toanju
reviewed
Jul 24, 2025
f33db7a to
d6253db
Compare
If we do not want to suspend requests (max_sleep_time = 0), the lua scripts, calculating the rate limit, always returns 0 for the Retry-After Header value. Tools like terraform/OpenTofu will not slow down their deployment process, but instead simply abort. With this commit the lua scripts returns the correct value rather than 2 * max_sleep_time. Additionally we ensure never to return zero to the client and log a warning if the lua script calculates zero as value. This commit adds three test cases for the rate limit calculus: 1. No limit reached 2. Limit reached and suspension 3. Limit reached and no suspension
We do not support python version 2, so we remove it from the setup.cfg. Run tox with multiple python versions.
d6253db to
440c0cb
Compare
rhalina
approved these changes
Jul 25, 2025
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.
If we do not want to suspend requests (max_sleep_time = 0), the lua scripts, calculating the rate limit, always returns 0 for the Retry-After Header value. Tools like terroform/opentofu will not slow down their deployment process, but instead simply abort
With this commit the lua scripts returns the correct value rather than 2 * max_sleep_time. Introducing a boolean indicating whether a request is suspended or not.
This commit adds three test cases for the rate limit calculus: