Skip to content

Duplicate Trace ID #7

Description

@shayanh

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions