Skip to content

remove c rand from the standard retry strategy#3754

Open
sbiscigl wants to merge 1 commit intomainfrom
remove-rand
Open

remove c rand from the standard retry strategy#3754
sbiscigl wants to merge 1 commit intomainfrom
remove-rand

Conversation

@sbiscigl
Copy link
Contributor

Description of changes:

Removes the usage of the c api "rand" from the standard retry strategy in favor of the c++ API random generator std::mt19937. We refactor the thread local instance of std::mt19937 used for pseudo random UUIDs to be used in both UUID and standard retry strategy.

More importantly we remove the usage of srand in the retry strategy constructor that lead to re-initialization of global state for rand each time the constructor was called.

no tests were added as current coverage is sufficient enough

Check all that applies:

  • Did a review by yourself.
  • Added proper tests to cover this PR. (If tests are not applicable, explain.)
  • Checked if this PR is a breaking (APIs have been changed) change.
  • Checked if this PR will not introduce cross-platform inconsistent behavior.
  • Checked if this PR would require a ReadMe/Wiki update.

Check which platforms you have built SDK on to verify the correctness of this PR.

  • Linux
  • Windows
  • Android
  • MacOS
  • IOS
  • Other Platforms

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@sbiscigl sbiscigl marked this pull request as ready for review March 18, 2026 17:21
@sbiscigl sbiscigl force-pushed the remove-rand branch 4 times, most recently from 297b9aa to 3627e38 Compare March 18, 2026 17:43
@sbiscigl sbiscigl force-pushed the remove-rand branch 2 times, most recently from 4ec4e17 to 7fcafee Compare March 18, 2026 18:35
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.

3 participants