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

Delays generated by DecorrelatedJitterBackoffV2 are always shorter than delays generated by ExponentialBackoff #34

Open
alasdairstarky opened this issue Nov 17, 2023 · 0 comments

Comments

@alasdairstarky
Copy link

Summary:

Given that DecorrelatedJitterBackoffV2 uses takes the median of the inital delay, I had expected that the sum of all delay times would sometimes be higher than the sum of all delay times generated by ExponentialBackoff. This does not seem to be the case. Maybe I am misunderstanding? Can we be guaranteed that the sum of the DecorrelatedJitterBackoffV2 delays will always be less than the sum of the ExponentialBackoff delays?

I want to know as I am trying to understand the maximum amount of time that an operation could take including timeouts, delays and retries.

Here are the inputs:

initialDelay: 300ms
retryCount: 3

First generate a list of delays using ExponentialBackoff. Sum the total of all of these delays. (2,100ms)
Next generate lists of delays using DecorrelatedJitterBackoffV2. Sum the total of all of these delays and compare to the sum from ExponentialBackoff.



Expected behavior:

Sometimes the sum of the delays generated by DecorrelatedJitterBackoffV2 is greater than the sum of the delays generated by ExponentialBackoff.



Actual behaviour:

The sum of the delays generated by DecorrelatedJitterBackoffV2 is never greater than the sum of the delays generated by ExponentialBackoff.

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

1 participant