docker-container: avoid fail if container conflict#2000
Merged
crazy-max merged 1 commit intodocker:masterfrom Aug 21, 2023
Merged
docker-container: avoid fail if container conflict#2000crazy-max merged 1 commit intodocker:masterfrom
crazy-max merged 1 commit intodocker:masterfrom
Conversation
Fixes the race condition where two boots are executed simultaneously across multiple processes. We initially check to see if the container exists, but if during container creation we get a name conflict, we don't treat this error as a hard failure, and instead move immediately into waiting for the node to boot. Signed-off-by: Justin Chadwell <me@jedevc.com>
crazy-max
approved these changes
Aug 10, 2023
Member
crazy-max
left a comment
There was a problem hiding this comment.
LGTM. What I was thinking with locking the instance file was to avoid race cond when bootstrapping but that should not be an issue for other drivers.
Collaborator
Author
|
I guess the file lock approach also doesn't work very well if the daemon is remote. e.g. the daemon is remote on a server, and multiple clients are accessing it. |
Member
Yes indeed. I wonder if we should have smth similar to what you have done here for k8s 🤔 (cc @AkihiroSuda) |
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.
Fixes the race condition where two boots are executed simultaneously across multiple processes.
Additionally, this would probably also fix #1868.
We initially check to see if the container exists, but if during container creation we get a name conflict, we don't treat this error as a hard failure, and instead move immediately into waiting for the node to boot.
Not 100% sure about this, we could alternatively attempt to get a file lock when attempting to create the docker container (@crazy-max's suggestion).