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

Exponential backoff with jitter retry? #3549

Closed
JimNero009 opened this issue Mar 7, 2025 · 6 comments
Closed

Exponential backoff with jitter retry? #3549

JimNero009 opened this issue Mar 7, 2025 · 6 comments

Comments

@JimNero009
Copy link
Contributor

Hello,

I've been seeing some intermittent TImeout errors with our Redis instance. I can't find any underlying reason why that might be, so I was just going to add a retry mechanism to our configuration (we currently have none).

Being in the AWS world a fair bit, a recommended strategy there is for an exponential backoff with jitter. I notice that in this library you have a wide range of strategies, but not that one. EqualJitterBackoff seems quite close but not exactly the same.

I was interested in why this is? Do you feel actually the range you already have cover all reasonable usecases already? In which case, would you suggest I use those over creating a new class for this (which I would be happy to contribute back)?

@vladvildanov
Copy link
Collaborator

@JimNero009 Hi! You're right the EqualJitterBackoff is precisely what you need, but I agree it makes sense to support a combination Exponential Backoff + Jitter, feel free to contribute

@JimNero009
Copy link
Contributor Author

JimNero009 commented Mar 7, 2025

Thanks Vladyslav! Expect something soon 🚀, but I think EqualJitterBackoff is perfectly fine for this particular use case I have.

@JimNero009
Copy link
Contributor Author

#3550 for your perusal. I didn't see any direct tests for these classes, but point me to them if there is something.

@vladvildanov
Copy link
Collaborator

@JimNero009 You're right, there's no tests for now, please create a new file test file and add coverage for your changes

@yuanshibtc
Copy link

@JimNero009
We started experiencing intermittent timeouts with our AWS Redis instance last week as well, and we still haven't identified the issue yet.

@JimNero009
Copy link
Contributor Author

Merged in #3550

Thanks for being receptive to this!

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

No branches or pull requests

3 participants