Fixes #38978 should kill all children process when delete the task#38980
Fixes #38978 should kill all children process when delete the task#38980lifubang wants to merge 1 commit intomoby:masterfrom
Conversation
Signed-off-by: Lifubang <[email protected]>
|
ping @dmcgowan @crosbymichael PTAL (also the discussion on containerd/containerd#3149) |
|
I think we may not wait containerd/containerd#3149 , because it is used to fix who use libcontainerd by themselves, of course include docker. |
|
If someone worry about this patch. I think we can use And don't make containerd shim service stuck at any time. Please see containerd/containerd#3168 |
|
Can you explain, is this still needed now that we've bumped to containerd 1.2.7? |
|
Also, can we add a test case for shared pid ns? |
|
@lifubang need rebase |
|
@lifubang Are you still working on this? Is this still needed |
|
I think this can be closed as there have been a few patches in containerd regarding this issue. Thanks! |
Signed-off-by: Lifubang [email protected]
- What I did
Since containerd v1.2.0-rc.0, if we use
PIDNamespace, the shim service will not callruncKillAllmethod to kill all the children process when the container's main process exited.So, it will cause the issue #38978.
- How I did it
To fixes #38978 , we should call
KillAllwhenDeleteTask. It is safe because there were no two containers with the same cgroup path.As discussed in containerd/containerd#3149 , we may not remove
pidnamespacecheck because containerd should support containers with the same cgroup path.- How to verify it
The container with the same pid namespace can be stopped.
- Description for the changelog
add
containerd.WithProcessKillwhen delete a task in containerd.