Ignore networks that disappear during discovery #1815
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.
On systems where we have multiple concurrent deployments and teardowns of virtual machines that overlap, there are occasions where setup can fail if teardown of another vagrant deployment is happening in parallel. Generally this is handled well, but the most common place of failure was in the network enumeration where details of all existing networks are collected prior to creating new ones.
Since a number of operations are done after
driver.list_all_networks
and in cases where the number of networks is relatively large, it was common for a network to be destroyed during the iterations of that loop and thus the XML lookup or queries forbridge_name
etc would fail.My change here is just to rescue any errors that occur in this loop and continue on. I understand this is a bit of a niche issue for us in the way vagrant-libvirt is used at scale, and this might mask other problems besides networks being cleaned up, but opening this PR anyway for thoughts.