Use github.com/google/uuid to generate UUIDv4 #9083
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes proposed by this PR
We found UUID collisions occurring in our cluster. We thought it was
impossible but I decided to look into the library we were using for UUID
generation and found this issue: nu7hatch/gouuid#28
Which would explain some of the errors I've seen where the only possible
explanation was that we got the same UUID twice.
Notes to reviewer
The error we were seeing was this:
I dug into how we generate this handle and found we use the
nu7hatch/gouuid
to generate the UUID. We trusted that this UUID would be truly random so of course the database doesn't have any protections against two containers being made with the same handle. We also don't do any checks ourselves that the handle has been used. Doing so would be a waste of CPU for the web and database assuming that your UUID library generates unique UUID's.I'm trusting this new library more since it is maintained by Google and they're probably using this in their own production apps.
Related PR concourse/houdini#2
Release Note