-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
The "x/mongo/driver/uuid package currently uses "crypto/rand" as its randomness source for generating UUIDs. The cryptographically secure randomness source on some systems can be extremely slow. Also, the driver sessions specification specifically suggests using a pseudo-random number generator.
See a CockroachDB discussion on "crypto/rand" performance for more context.
Definition of done:
- "x/mongo/driver/uuid uses "math/rand" instead of "crypto/rand".
- "x/mongo/driver/uuid uses a package-specific random reader, not the global random reader.
- Seed the "math/rand" pseudo-random number generator with the current time.
- related to
-
GODRIVER-2349 Prevent session ID reuse due to lower-than-expected system clock resolution
- Closed
-
GODRIVER-2361 Investigate using "x/exp/rand" or "google/uuid" packages to improve UUID generation
- Closed