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

Use default rand in jitteredDuration #118

Merged
merged 1 commit into from
Mar 23, 2022
Merged

Use default rand in jitteredDuration #118

merged 1 commit into from
Mar 23, 2022

Conversation

psampaz
Copy link
Contributor

@psampaz psampaz commented Mar 23, 2022

jitteredDuration introduced in #116 uses rand.NewSource which is not safe for concurrent use by multiple goroutines.
https://github.com/golang/go/blob/8f53fad035ccc580859f7b063ae8be30b009a6be/src/math/rand/rand.go#L41

This PR updates jitterredDuration to use the default rand (the default Source is safe for concurrent use by multiple goroutines) which is already seeded in https://github.com/adjust/rmq/blob/master/rand.go#L9

@psampaz psampaz merged commit ee22f19 into master Mar 23, 2022
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