-
Notifications
You must be signed in to change notification settings - Fork 39
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
[WIP] Solve some concurrency issues #621
Open
nvgoldin
wants to merge
5
commits into
lago-project:master
Choose a base branch
from
nvgoldin:uuid4
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
nvgoldin
commented
Jul 1, 2017
- Use uuid4 instead of uuid1, so we do not give the same network names in parallel runs.
- Let libvirt generate the bridge name - here I think I hit occasionally a race condition in libvirt(one run complains the bridge name already exists, because the other process just created it). According to libvirt docs the bridge name will be auto-generated, however it does not talk directly about parallel-safety. If indeed this an issue, we'll have to generate the bridge name too, which will be little more constrained than the network names because it has a lower limitation on the number of chars(16 iirc).
nvgoldin
commented
Jul 1, 2017
lago/virt.py
Outdated
str: prefixed identifier for the given unprefixed name | ||
str: prefixed identifier for the given unprefixed name, with all | ||
none alphanumeric characters in the unprefixed name replaced | ||
with a 'L' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self - probably better replacing it with a random char.
nvgoldin
force-pushed
the
uuid4
branch
8 times, most recently
from
July 26, 2017 13:11
155429f
to
66a3c24
Compare
ci test please |
Until now the prefix uuid was generated with 'uuid1' command. In cases where you started two environments with the same network names - the uuid1 usage caused us to pass the same network name to libvirt, despite the environments being different, thus throwing a libvirt error. The reason is that we truncated the 8 last bytes of the uuid1 and joined that with the network name. The 8 last bytes of uuid1 are most definitely not random. I see no reason to have the uuid not completely random - therefore this patch changes the prefix uuid to be generated with uuid4, which should be completely random. Signed-off-by: Nadav Goldin <[email protected]>
This patch changes the 'prefixed_name' function logic, so it will generate unique names, based on the Prefix UUID4 and the SHA256 hash of the passed name. This is required as we use those names in passed network names to libvirt. Signed-off-by: Nadav Goldin <[email protected]>
Signed-off-by: Nadav Goldin <[email protected]>
Signed-off-by: Nadav Goldin <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.