runc icon indicating copy to clipboard operation
runc copied to clipboard

The 'runc delete --force' command can't delete container if runc receives a SIGKILL before it can generate the state.json file.

Open jianghao65536 opened this issue 1 year ago • 0 comments

Description

This issue will occur if the following conditions are met simultaneously:

  1. The container engine has a set timeout. (runc will receive a SIGKILL if it times out)
  2. runc receives a SIGKILL before procReady

This issue has the following effects:

  1. It leaves residuals in the cgroup.
  2. If runc gets terminated before it can write 'THAWED' into the freezer.state while setting up the cgroup, then the runc init will hang. 4481 4228
  3. The 'runc delete --force' command will fail because the state.json file isn't generated.

Steps to reproduce the issue

  1. add time.Sleep(20 * time.Sleep) before this line.
  2. runc --systemd-cgroup run test_container &
  3. kill -9 $!
  4. runc delete test_container --force
{B4F6E40E-1F72-46F5-9320-3E896DCA7D2F}

Describe the results you received and expected

We're hoping that the 'runc delete --force' command will run as expected.

What version of runc are you using?

v1.1.15

Host OS information

NAME="CentOS Linux" VERSION="7 (Core)" ID="centos" ID_LIKE="rhel fedora" VERSION_ID="7" PRETTY_NAME="CentOS Linux 7 (Core)" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:centos:centos:7" HOME_URL="https://www.centos.org/" BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7" CENTOS_MANTISBT_PROJECT_VERSION="7" REDHAT_SUPPORT_PRODUCT="centos" REDHAT_SUPPORT_PRODUCT_VERSION="7"

Host kernel information

4.18

jianghao65536 avatar Nov 18 '24 11:11 jianghao65536