containerd icon indicating copy to clipboard operation
containerd copied to clipboard

shim process residual when kill containerd during container start

Open Vanient opened this issue 5 years ago • 3 comments

Description sometimes shim process residual when kill containerd during container start.

Steps to reproduce the issue:

  1. docker run -itd ubuntu bash
  2. kill -15 $(pidof containerd)

Describe the results you received: a shim process residual, container's status is Created. If you start container again, there will be two shim process belong to this container. (Of course only one works) image

Describe the results you expected: no shim process residual

Output of containerd --version: containerd github.com/containerd/containerd v1.5.0-beta.0-60-g5f2d02a.m 5f2d02adc5628ba62ede7dd4a742df8dcd07a0c2.m

Any other relevant information: A way to reproduce it. add sleep in client.WithStart(c.Shim, b.shimAddress(ns), daemonAddress, cgroup, c.ShimDebug, exitHandler) start a container and kill containerd during sleep image

Vanient avatar Feb 06 '21 11:02 Vanient

I'm seeing the same issue.When deleting a Pod, the process in the container has exited, but the containerd-shim was still there, then kubelet keeps trying to kill the unwanted Pod.I'm using containerd v1.4.3 and v1.2.6.

pigletfly avatar Mar 26 '21 08:03 pigletfly

Two shim, one was spawned by old containerd before killed, which ppid will change to 1. And the other was spawned by the new containerd, which is the current work shim. This can also be reproduced by change contaienrd config's state.

zvier avatar Apr 13 '21 02:04 zvier

Two shim, one was spawned by old containerd before killed, which ppid will change to 1. And the other was spawned by the new containerd, which is the current work shim. This can also be reproduced by change contaienrd config's state.

If the containerd-shim's ppid is 1, need to be cure by devops I think.

zvier avatar Apr 13 '21 02:04 zvier