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

Ops is seeing duplicate UUID's being generated from multiple sandboxes #87

Closed
trink opened this issue Apr 29, 2015 · 3 comments
Closed

Comments

@trink
Copy link
Contributor

trink commented Apr 29, 2015

There are a few issues:

  1. between separate processes (they most likely used the same seed, since it is just time_t). A better seed should be used.
  2. srand/rand are not thread safe in C so the behaviour probably isn't matching expectations
    2a) the Lua math library uses srand/rand so it should also be addressed there.
  3. the modulo operation does not generate uniformly distributed random numbers in the span (lower numbers are slightly more likely).
@trink
Copy link
Contributor Author

trink commented Apr 29, 2015

Digging: glibc has a lock around it so comment 2 should not be a problem for the Ops deploy
https://sourceware.org/git/?p=glibc.git;a=blob;f=stdlib/rand.c;hb=glibc-2.15#l26
https://sourceware.org/git/?p=glibc.git;a=blob;f=stdlib/random.c;hb=glibc-2.15#l292

@trink
Copy link
Contributor Author

trink commented Apr 29, 2015

@whd was the duplication between processes or within a process?

@trink
Copy link
Contributor Author

trink commented May 11, 2015

Closed via #88

@trink trink closed this as completed May 11, 2015
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

No branches or pull requests

1 participant