You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that the same problem was discovered for loading state from file --- there's code in the constructor to modify the internal state using the current pid (see https://github.com/eserte/Data-UUID/blob/49bada021afbff62f2aef6b6981a1ff222f77913/UUID.xs#L370 ). Without this modification same UUIDs may be generated for independent processes which use the same /tmp/.UUID_STATE.
Unfortunately perl has no concept of callbacks on forks, which could be used to fix things (e.g. change the internal Data::UUID state in the forked child)
Probably the problem can be fixed by always using the current pid when calculating the internal state. This means an additional getpid() call on every UUID creation (on my systems that's an overhead of 5µs to 25µs per call).
As demonstrated in this blog post, it appears duplicate UUIDs can be generated after forking:
I take no credit for discovering this. I am just opening the issue as I didn't see one already.
The text was updated successfully, but these errors were encountered: