EmbarkStudios / EmbarkStudios/tryhard

Add jitter option for backoff strategies

Open
#23 3 comments 6 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
248
Forks
11
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**
When executing many requests with a fixed backoff strategy, it's possible that requests will timeout and be retried simultaneously. If the cause for the the timeout was due to "competition", it's likely that the requests will continue to compete and timeouts will continue to happen. To make this less likely, I would like to "spread" requests out over an interval instead.

I.e. I would like the ability to go from this:
![image](https://user-images.githubusercontent.com/20171455/166637205-578d2bfc-ff4c-4478-8b66-ed29ebaf0a6f.png)

To this:
![image](https://user-images.githubusercontent.com/20171455/166637591-f6eb0f04-1a91-48e3-95f9-9a043f10fc8c.png)

**Describe the solution you'd like**
I would like to add the possibility of adding a jitter to backoff strategies, such that retries are less likely to occur at the same time.
The jitter would pick a random number between a backoff interval instead of picking a fixed duration.

**Additional context**
The figures above are from this blog post, which describes the problem in greater detail: https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.