-
Notifications
You must be signed in to change notification settings - Fork 41.1k
Move network plugin TearDown to DockerManager #7449
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
Conversation
err := dm.networkPlugin.TearDownPod(pod.Namespace, pod.Name, kubeletTypes.DockerID(container.ID)) | ||
if err != nil { | ||
glog.Errorf("Failed tearing down the infra container: %v", err) | ||
errs <- err |
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.
Seems errs<- err
will block when in the worst case, teardown + all kill container fails.
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.
The won't block since the channel is buffered no? (this is the same code we had before btw)
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.
Yes. I just noticed that, it seems to be a historical problem. So the buffered size is len(pod.Containers)
, while we will send at most len(pod.Containers) + 1
(the 1 came from the tear down) errors. And since no one is receiving the channel, it can block I think?
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.
You're completely right, nice catch :) will fix.
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.
Pushed a fix.
Nice job! Seems we are able to move |
This teardown is Docker-specific and will let us also do the setup in the manager in future cleanups.
0ef3c62
to
787d42d
Compare
@vmarmol Awesome! Are you moving the |
@yifan-gu that's what I'm working on now :) ran into an issue with a circular dependency of |
👍 👍 LGTM |
LGTM. Merging since travis is green. Shippable failure is unrelated. |
Move network plugin TearDown to DockerManager
/cc @dchen1107 @yifan-gu