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

Fix panics in DurationWithJitter utils when computed variance is zero. #10507

Merged
merged 6 commits into from
Jan 24, 2025

Conversation

seizethedave
Copy link
Contributor

@seizethedave seizethedave commented Jan 24, 2025

What this PR does

Fixes a panic in DurationWithJitter, DurationWithPositiveJitter, DurationWithNegativeJitter when small inputs result in a variance of zero, because rand.Int63n panics on zero.

Checklist

  • Tests updated.
  • Documentation added.
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX].
  • about-versioning.md updated with experimental features.

@seizethedave seizethedave changed the title Fix panic in util.DurationWithJitter when variance is zero. Fix panics in DurationWithJitter utils when computed variance is zero. Jan 24, 2025
@seizethedave seizethedave marked this pull request as ready for review January 24, 2025 01:44
@seizethedave seizethedave requested a review from a team as a code owner January 24, 2025 01:44
Copy link
Contributor

@aknuds1 aknuds1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks.

Copy link
Contributor

@narqo narqo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 Terrific finding, thank you

Copy link
Contributor

@gotjosh gotjosh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

CHANGELOG.md Outdated Show resolved Hide resolved
@seizethedave seizethedave merged commit ad6778e into main Jan 24, 2025
28 checks passed
@seizethedave seizethedave deleted the davidgrant/duration-with-jitter branch January 24, 2025 17:23
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.

4 participants