rs / xid

xid is a globally unique id generator thought for the web

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Usage in docker

vincentserpoul opened this issue · comments

I'm always running my golang executables within containers in docker.
The PID is then always 1, which then defeats the purpose of having this field.

Would there be any possible replacement?

The least would be to specify this caveat in the README I think.

What about hashing the content of /cpu/1/cpuset if the PID is 1 and the file exists?

Please check b48c0f5 and tell me if it would fix your issue.

Quick response!
Yes, it does work perfectly.
I ran benchmarks within docker, the performance doesn't seem affected as well.

@rs I think that even if the processing of pid is added, there is still no guarantee that the xids generated by the two containers are unique.This method only reduces the probability of recurrence.We're running into a recurring issue during our production environment because the pid is same in two different containers, do you have any good advice?