8000 stopping containers before killing the daemon by Boolman · Pull Request #22695 · moby/moby · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

stopping containers before killing the daemon #22695

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

Closed
wants to merge 1 commit into from
Closed

stopping containers before killing the daemon #22695

wants to merge 1 commit into from

Conversation

Boolman
Copy link
@Boolman Boolman commented May 12, 2016

gracefully stop the docker containers

@GordonTheTurtle GordonTheTurtle added status/0-triage dco/no Automatically set by a bot when one of the commits lacks proper signature labels May 12, 2016
gracefully stop the docker containers

Signed-off-by: Emil Öhgren <emil.ohgren@deltaprojects.com>
@GordonTheTurtle GordonTheTurtle removed the dco/no Automatically set by a bot when one of the commits lacks proper signature label May 12, 2016
@thaJeztah
Copy link
Member

Can you explain why this is needed? The daemon should stop all containers on shutdown, but after 10 (15?) seconds, it sends a KILL for those containers that failed to shutdown within that period. There's currently a PR to make that configurable, see #22566

@Boolman
Copy link
Author
Boolman commented May 12, 2016

if I issue a 'stop docker', all my containers is killed. works perfectly when I added my fix.

is it 10s to stop ALL containers or 10s for each?
time docker stop ffd22f0c68b5
ffd22f0c68b5

real 0m0.689s
user 0m0.020s
sys 0m0.004s

logs from upstart/docker.log
time="2016-05-12T12:13:52.537342069+02:00" level=info msg="Processing signal 'terminated'"
time="2016-05-12T12:13:52.598256199+02:00" level=warning msg="container 344409d741089316919e0475b4ca1768ed02a905f8be1129a4833e6aa8083238 restart canceled"
time="2016-05-12T12:13:52.611293696+02:00" level=warning msg="container fb0831119e925e620a2f0fffb4274175354a26618e9e8a5ba5c8ec77ac374371 restart canceled"
time="2016-05-12T12:13:58.459363508+02:00" level=warning msg="container 04a2ced4068ba358e7d94c896972456ce1b59f28c64c0474d740e9f6df49d943 restart canceled"
time="2016-05-12T12:13:58.649103262+02:00" level=warning msg="container 2c7dcd923410a7752f065e62db4e8e1d56313e4f1f78201630f2dc668d36c452 restart canceled"
time="2016-05-12T12:13:58.755320942+02:00" level=warning msg="container ce6a51290c70f10ef109cbda6898813bb6edac9deab0f86b492ca44791833e71 restart canceled"
time="2016-05-12T12:13:58.976799619+02:00" level=warning msg="container 64ce9d31aff9946b088f6df9ca98147b3bfa7265d9e9f572724aa076b28d6655 restart canceled"
time="2016-05-12T12:13:58.995663344+02:00" level=warning msg="container ba4daae70208fb1039dd5d762da744416a148529561d5b67403b6c22bf2fbf52 restart canceled"
time="2016-05-12T12:13:59.056861516+02:00" level=warning msg="container 06cd4b6b67382c0cb162711f34e48e57004a0a771d8a8a1f6fb1cfc8fffde20a restart canceled"
time="2016-05-12T12:13:59.877226914+02:00" level=warning msg="container d312e12f1aa9374e8d7c861cbdd9f96434302623e5c3b350aa3e638491834466 restart canceled"
time="2016-05-12T12:13:59.947912476+02:00" level=warning msg="container eee06bc88c1312055cd303569192aa38a9f31d08322e0774859d113cbdfe293b restart canceled"
time="2016-05-12T12:14:00.177908152+02:00" level=warning msg="container 2635310a5e8e075c72aaad78d2d7465e62c375cf5bb6903dee117ed71ef7d25f restart canceled"
time="2016-05-12T12:14:02.538748171+02:00" level=info msg="Container 69ba9085df1ae014e1010cc29a11f136a64da0f337c5a962e26cc5adff87a471 failed to exit within 10 seconds of signal 15 - using the force"
time="2016-05-12T12:14:02.590476084+02:00" level=warning msg="container 69ba9085df1ae014e1010cc29a11f136a64da0f337c5a962e26cc5adff87a471 restart canceled"
INFO[72059] stopping containerd after receiving terminated

@thaJeztah
Copy link
Member

@Boolman it's 10 secon 8000 ds for each container. What is running in your container? Are they handling signals properly? If the process inside the container doesn't handle a SIGTERM, then docker will always send a SIGKILL after 10 seconds, also see the output;

Container xxx failed to exit within 10 seconds of signal 15 - using the force

@Boolman
Copy link
Author
Boolman commented May 12, 2016

yes they handle signals properly, I run ceph and consul on these containers. yes I saw that one container in the logs is taking longer than 10s. but ALL my containers is being killed

@cpuguy83
Copy link
Member

Docker already stops all containers on exit (with SIGTERM, then SIGKILL if SIGTERM was not handled).
Containers are all signaled asynchronously and handled as separate cases for sending SIGKILL.

Closing as this is not needed.
If you are seeing a specific issue, please open an issue with relevant logs, repro case, etc.

Thanks for the contribution.

@cpuguy83 cpuguy83 closed this May 12, 2016
@thaJeztah
Copy link
Member

I think #22566 is the better approach for this, as it would work, independently of the process manager in use

@Boolman Boolman deleted the patch-1 branch May 12, 2016 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0