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

The delay with jitter can be equal to 0 #57

Open
Corvus278 opened this issue Mar 16, 2023 · 1 comment
Open

The delay with jitter can be equal to 0 #57

Corvus278 opened this issue Mar 16, 2023 · 1 comment

Comments

@Corvus278
Copy link

Corvus278 commented Mar 16, 2023

in the fullJitter function, a random number is used to calculate the delay, which is multiplied by prevDelay*e^attemptNumber.
But Math.random() can return 0, and then the total delay before repeating the request will be 0.
Is this a bug, or ok?

image

@andrewstephencooper
Copy link

@Corvus278 Rather than returning the delay, this function merely returns the jitter. As such, the jitter may be zero, but that would not result in the delay being zero.

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

2 participants