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

Duplicate Trace ID #7

Open
shayanh opened this issue Apr 16, 2021 · 0 comments
Open

Duplicate Trace ID #7

shayanh opened this issue Apr 16, 2021 · 0 comments

Comments

@shayanh
Copy link
Member

shayanh commented Apr 16, 2021

Hi,

There is a problem with generating Trace IDs that causes having duplicated ones. It's possible to reproduce this problem by running CreateTrace() in parallel at the same time.

The problem is because of the way we generate random numbers. Currently, we found two alternative approaches that we think have much less probability to generate the same random numbers.

Using crypto/rand:

https://golang.org/pkg/crypto/rand/
https://blog.gopheracademy.com/advent-2017/a-tale-of-two-rands/

Using current time and pid as seed:

We can use something like this, as used here in the line 25:
https://golang.org/src/io/ioutil/tempfile.go

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