Skip to content
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

containerd: specify killmode=mixed #652

Merged
merged 1 commit into from
Jan 15, 2020
Merged

Conversation

etungsten
Copy link
Contributor

@etungsten etungsten commented Jan 15, 2020

Issue #, if available: #289

Description of changes:
Changes containerd.service's KillMode from process to mixed.

KillMode=mixed is needed because when containerd.service shuts down, systemd also needs to send termination signals to its child containerd-shim processes.
Otherwise the system gets stuck on waiting for containerd-shim processes to stop when trying to reboot

Testing:
With KillMode=process (before this change):

.....
[�[0;32m  OK  �[0m] Stopped �[0;1;39mlibcontainer conta���e386221259872faea0a9e9c6a912d�[0m.
�[K[�[0;32m  OK  �[0m] Removed slice �[0;1;39mlibcontainer���_11ea_a850_02fe0b2a3c5c.slice�[0m.
[�[0;32m  OK  �[0m] Removed slice �[0;1;39mlibcontainer���iner kubepods-burstable.slice�[0m.
[�[0;32m  OK  �[0m] Removed slice �[0;1;39mlibcontainer container kubepods.slice�[0m.
[�[0;32m  OK  �[0m] Reached target �[0;1;39mShutdown�[0m.
[�[0;32m  OK  �[0m] Reached target �[0;1;39mFinal Step�[0m.
[�[0;32m  OK  �[0m] Started �[0;1;39mReboot�[0m.
[�[0;32m  OK  �[0m] Reached target �[0;1;39mReboot�[0m.
[  240.313308] systemd-shutdow: 43 output lines suppressed due to ratelimiting
[  240.322923] systemd-shutdown[1]: Syncing filesystems and block devices.
[  240.325975] systemd-shutdown[1]: Sending SIGTERM to remaining processes...
[  240.330833] systemd-journald[838]: Received SIGTERM from PID 1 (systemd-shutdow).
[  250.332130] systemd-shutdown[1]: Waiting for process: containerd-shim, containerd-shim, containerd-shim
[  330.334825] systemd-shutdown[1]: Sending SIGKILL to remaining processes...
[  330.338875] systemd-shutdown[1]: Sending SIGKILL to PID 3059 (containerd-shim).
[  330.342323] systemd-shutdown[1]: Sending SIGKILL to PID 3060 (containerd-shim).
[  330.345780] systemd-shutdown[1]: Sending SIGKILL to PID 3903 (containerd-shim).
[  330.350285] systemd-shutdown[1]: Unmounting file systems.

With KillMode=mixed:

[K[�[0;32m  OK  �[0m] Stopped �[0;1;39mlibcontainer conta���19ba2b79b2277925b84c855a2830e�[0m.
�[K[�[0;32m  OK  �[0m] Removed slice �[0;1;39mlibcontainer���_11ea_a850_02fe0b2a3c5c.slice�[0m.
[�[0;32m  OK  �[0m] Removed slice �[0;1;39mlibcontainer���iner kubepods-burstable.slice�[0m.
[�[0;32m  OK  �[0m] Removed slice �[0;1;39mlibcontainer container kubepods.slice�[0m.
[�[0;32m  OK  �[0m] Reached target �[0;1;39mShutdown�[0m.
[�[0;32m  OK  �[0m] Reached target �[0;1;39mFinal Step�[0m.
[�[0;32m  OK  �[0m] Started �[0;1;39mReboot�[0m.
[�[0;32m  OK  �[0m] Reached target �[0;1;39mReboot�[0m.
[  146.934703] systemd-shutdown[1]: Syncing filesystems and block devices.
[  146.939223] systemd-shutdown[1]: Sending SIGTERM to remaining processes...
[  146.945179] systemd-journald[864]: Received SIGTERM from PID 1 (systemd-shutdow).
[  146.980919] systemd-shutdown[1]: Sending SIGKILL to remaining processes...
[  146.986548] systemd-shutdown[1]: Unmounting file systems.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

KillMode=mixed is necessary because when containerd.service shuts down
it also needs to reap its child `containerd-shim` processes. Otherwise
the system gets stuck on waiting for shim processes to stop when trying to reboot
Copy link
Contributor

@zmrow zmrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍦

@etungsten etungsten merged commit 033ad21 into develop Jan 15, 2020
@etungsten etungsten deleted the containerd-killmode branch January 15, 2020 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants