Skip to content
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
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

nvgoldin
Copy link
Contributor

@nvgoldin nvgoldin commented Jul 1, 2017

  1. Use uuid4 instead of uuid1, so we do not give the same network names in parallel runs.
  2. 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).

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'
Copy link
Contributor Author

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 nvgoldin force-pushed the uuid4 branch 8 times, most recently from 155429f to 66a3c24 Compare July 26, 2017 13:11
@nvgoldin
Copy link
Contributor Author

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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant