Skip to content

Retry-After on rate limiter hit for REST API - #5917

Merged
agourlay merged 6 commits into
devfrom
retry-after-header-rate-limiting
Feb 10, 2025
Merged

agourlay merged 6 commits into
devfrom
retry-after-header-rate-limiting

Conversation

@agourlay

Copy link
Copy Markdown
Member

The rate limiter now computes a retry-after field in its error to feed to the Retry-After HTTP header.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After

Comment thread tests/openapi/test_strictmode.py Resolved
Comment thread src/actix/helpers.rs Resolved
Comment thread lib/collection/src/operations/types.rs Resolved

@timvisee timvisee left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made a few changes to push it to the finish line. See the (now resolved) comments above.

@agourlay
agourlay merged commit d4e0aaa into dev Feb 10, 2025
@agourlay
agourlay deleted the retry-after-header-rate-limiting branch February 10, 2025 10:27
timvisee added a commit that referenced this pull request Feb 11, 2025
* Retry-After on rate limiter hit for REST API

* fix tests

* Ceil retry after seconds number so clients don't retry too early

* Relax retry after time requirement a bit in case CI machines are slow

* Add rate limit test, test retry after if we replanish within a second

* Report time to wait in rate limit error

---------

Co-authored-by: timvisee <[email protected]>
@timvisee timvisee mentioned this pull request Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants