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

add initialJitter feature #66

Merged
merged 3 commits into from
Mar 21, 2024
Merged

add initialJitter feature #66

merged 3 commits into from
Mar 21, 2024

Conversation

daern91
Copy link
Contributor

@daern91 daern91 commented Mar 21, 2024

I accidentally closed #57, opening a new one :-)

We ran into a case where we need to use an initialJitter to randomize a delay for the first call attempt too.

PR adds this.

  • Test
  • Code
  • Docs

@daern91 daern91 mentioned this pull request Mar 21, 2024
3 tasks
mdlavin
mdlavin previously approved these changes Mar 21, 2024
@mdlavin
Copy link
Member

mdlavin commented Mar 21, 2024

@daern91 thanks for the new signed commit. It looks like one of the tests failed

@daern91
Copy link
Contributor Author

daern91 commented Mar 21, 2024

@daern91 thanks for the new signed commit. It looks like one of the tests failed

Wow, what a nice catch in CI. Thanks for the heads up @mdlavin!

It took me a couple of attempts to reproduce this error. My theory is that it was because we fired off the setTimeout without awaiting it. It could be that this caused problems for the event loop when we ran a lot of retries at the same time, as in the test setup.

After updating the sleep function in this commit: c1a7cd0

I was no longer able to reproduce it.

edit: I also updated the tests to remove the check for larger than 0 jitter. It didn't make sense since technically we can get a 0 jitter time and it's also not included in the other jitter tests. ref.

Now the PR should be good to merge.

@mdlavin mdlavin merged commit 2087db6 into lifeomic:master Mar 21, 2024
4 checks passed
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