Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dont take into account context canceled and rate limit errors in redis limiter. #309

Merged

Conversation

fische
Copy link
Contributor

@fische fische commented May 7, 2024

I realised the redis limiter takes into account context cancellation errors and bumps the rate limiter if it sees that error. With mettle workers, this wasn't a big issue, but now elan hits redis as well, clients may cancel their requests.
It seems if Allow returns an error, the client will report it to the Limiter as well using ReportResult which I wasn't expecting, so I've added the rate limit error to the ones we exclude in ReportResult.
This PR also includes some tests for the limiter to make sure it actually works :D

@fische fische requested review from peterebden, Hamishpk and Liu-ko May 7, 2024 15:35
@fische fische self-assigned this May 7, 2024
@fische fische changed the title Dont take into account context canceled errors in redis limiter. Dont take into account context canceled and rate limit errors in redis limiter. May 8, 2024
ChangeLog Outdated Show resolved Hide resolved
Liu-ko
Liu-ko previously approved these changes May 8, 2024
Co-authored-by: Tatiana Iljushenko <[email protected]>
@fische fische merged commit b9f7fd0 into thought-machine:master May 8, 2024
5 checks passed
@fische fische deleted the elan-redis-err-canceled-context branch May 8, 2024 09:21
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