-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Fix autostart for swarm scope connected containers #26449
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
37bc1e3
to
741b57d
Compare
@mrjana I think there is a timing issue between the overlay cleanup and container restart. when I have multiple containers with |
@mrjana i stand corrected. the above issue was not due to this PR. I had some stale bridges in my setup that resulted in this conflicting subnet in kernel < 3.16 (host-mode). With those stale bridges removed and using moby/libnetwork#1442, this works fine. |
LGTM |
1 similar comment
LGTM |
Side note, noticed that when you disconnect a container from a swarm network you get an error in the daemon logs: |
Can you add a test case for swarm daemon restart w/ attached container + autorestart? |
That's because the task is removed in the manager before the the dispatcher is processing an update about the task completing from the agent. |
Will add a test case |
The swarm scope network connected containers with autostart enabled there was a dependency problem with the cluster to be initialized before we can autostart them. With the current container restart code happening before cluster init, these containers were not getting autostarted properly. Added a fix to delay the container start of those containers which has atleast one swarm scope endpoint to until after the cluster is initialized. Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
@cpuguy83 Added a test case |
|
||
out, err = d.Cmd("ps", "-q") | ||
c.Assert(err, checker.IsNil) | ||
c.Assert(strings.TrimSpace(out), checker.Not(checker.Equals), "") |
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.
I understand it doesn't make a big difference. But it will be great if you can get the container-id prior to restart and then compare it here. that makes it more correct.
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.
There is only one container running on this daemon. So I don't think that is necessary.
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.
ok
LGTM |
Re-LGTM. win2lin failure is unrelated. merging. |
With swarm scope network connected containers with autostart enabled
there was a dependency problem with the cluster to be initialized before
we can autostart them. With the current container restart code happening
before cluster init, these containers were not getting autostarted
properly. Added a fix to delay the container start of those containers
which has atleast one swarm scope endpoint to until after the cluster is
initialized.
Signed-off-by: Jana Radhakrishnan mrjana@docker.com