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-shim-runc-v2 exit abnormally #6402

Closed
zvier opened this issue Jan 3, 2022 · 1 comment
Closed

containerd-shim-runc-v2 exit abnormally #6402

zvier opened this issue Jan 3, 2022 · 1 comment
Labels

Comments

@zvier
Copy link
Contributor

zvier commented Jan 3, 2022

Description

We cause an strange phenomenon that the container's containerd-shim-runc-v2 and process inside the container both exit, but docker ps can still list this container with Up state.

The containerd's log about it is:

containerd[3905483]: time="2022-01-02T21:53:01.309515034+08:00" level=info msg="shim disconnected" id=6ce9d405aaae9dfae615d0810ba46b4726c60607dd940233fe824b651158372e

containerd[3905483]: time="2022-01-02T21:53:01.312121940+08:00" level=warning msg="cleaning up after shim disconnected" id=6ce9d405aaae9dfae615d0810ba46b4726c60607dd940233fe824b651158372e namespace=moby

And we can sure that the dockerd not stop or kill the container initiatively. It seems like that the shim exit first, but no more information about how it works abnormal.

Steps to reproduce the issue

Not find the accurate way to reproduce this issue. Kill containerd-shim-runc-v2 can product the same phenomenon .

  1. docker run -itd busybox:latest
  2. kill -s 9 ${containerd-shim-runc-v2_pid}
  3. docker ps

If use containerd-shim, there is no this problem.

Describe the results you received and expected

First, if the containerd-shim-runc-v2 process exit about the container, I think the containerd need to publish TaskExit and TaskDelete event to dockerd to clean this dead container.

What problems may cause containerd-shim-runc-v2 exit anomaly ? May be this is a system problem, because all the containers on the host had this issue at the same time.

What version of containerd are you using?

1.4.3

Any other relevant information

runc --version

runc version 1.0.1

uname -r

4.18.0-2.3.8

Show configuration if it is related to CRI plugin.

#   Copyright 2018-2020 Docker Inc.

#   Licensed under the Apache License, Version 2.0 (the "License");
#   you may not use this file except in compliance with the License.
#   You may obtain a copy of the License at

#       http://www.apache.org/licenses/LICENSE-2.0

#   Unless required by applicable law or agreed to in writing, software
#   distributed under the License is distributed on an "AS IS" BASIS,
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#   See the License for the specific language governing permissions and
#   limitations under the License.

disabled_plugins = ["cri"]

#root = "/var/lib/containerd"
#state = "/run/containerd"
#subreaper = true
#oom_score = 0

#[grpc]
#  address = "/run/containerd/containerd.sock"
#  uid = 0
#  gid = 0

#[debug]
#  address = "/run/containerd/debug.sock"
#  uid = 0
#  gid = 0
#  level = "info"
@zvier zvier added the kind/bug label Jan 3, 2022
@zvier zvier changed the title docker ps can list the container when containerd-shim-runc-v2 exit containerd-shim-runc-v2 exit abnormally Jan 3, 2022
@fuweid
Copy link
Member

fuweid commented Feb 20, 2022

closed by #6452

@fuweid fuweid closed this as completed Feb 20, 2022
fuweid added a commit to fuweid/containerd that referenced this issue Feb 20, 2022
If containerd-shim-runc-v1 process dead abnormally, such as received
kill -s 9 signal, panic or other unkown reasons, the containerd-shim-runc-v1
server can not reap runc container and forward init process exit event.
This will lead the container leaked in dockerd. When shim dead, containerd
will clean dead shim, here read init process pid and forward exit event
with pid at the same time.

Related to: containerd#6402

Signed-off-by: Jeff Zvier <zvier20@gmail.com>
Signed-off-by: Wei Fu <fuweid89@gmail.com>
fuweid added a commit to fuweid/containerd that referenced this issue Feb 20, 2022
If containerd-shim-runc-v1 process dead abnormally, such as received
kill -s 9 signal, panic or other unkown reasons, the containerd-shim-runc-v1
server can not reap runc container and forward init process exit event.
This will lead the container leaked in dockerd. When shim dead, containerd
will clean dead shim, here read init process pid and forward exit event
with pid at the same time.

Related to: containerd#6402

Signed-off-by: Jeff Zvier <zvier20@gmail.com>
Signed-off-by: Wei Fu <fuweid89@gmail.com>
(cherry picked from commit 7901f4b)
Signed-off-by: Wei Fu <fuweid89@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants