Fix port forwarding collisions in parallel run of multi-machine env#226
Merged
legal90 merged 2 commits intoParallels:masterfrom Nov 5, 2015
Merged
Fix port forwarding collisions in parallel run of multi-machine env#226legal90 merged 2 commits intoParallels:masterfrom
legal90 merged 2 commits intoParallels:masterfrom
Conversation
It much easier and faster just to avoid the concurrency in this place. It guarantees that we will not create some port forwarding rules with the same names
Driver methods are slow. Since "forward_ports" action is now parallel-safe, we can call driver method "read_forwarded_ports" only once per each machine.
Contributor
|
👍 |
legal90
added a commit
that referenced
this pull request
Nov 5, 2015
Fix port forwarding collisions in parallel run of multi-machine env
This file contains hidden or 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
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.
While doing a parallel run of multi-machine environment the race condition could happen:
This PR fixes that by adding adds both class- and process-level locks, so port forwarding will be proceeded subsequently.
Also, I've improved the
forward_portshelper by decreasing the number of driver method calls. Now it should work a little bit faster.cc: @Gray-Wind @racktear @Kasen