File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -550,6 +550,20 @@ func (p *initProcess) start() (retErr error) {
550550 return fmt .Errorf ("unable to start init: %w" , err )
551551 }
552552
553+ // If the runc-create process is terminated due to receiving SIGKILL signal,
554+ // it may lead to the runc-init process leaking due
555+ // to issues like cgroup freezing,
556+ // and it cannot be cleaned up by runc delete/stop
557+ // because the container lacks a state.json file.
558+ // This typically occurs when higher-level
559+ // container runtimes terminate the runc create process due to context cancellation or timeout.
560+ // If the runc-create process terminates due to SIGKILL before
561+ // reaching this line of code, we won't encounter the cgroup freezing issue.
562+ _ , err = p .container .updateState (nil )
563+ if err != nil {
564+ return fmt .Errorf ("unable to store init state before creating cgroup: %w" , err )
565+ }
566+
553567 defer func () {
554568 if retErr != nil {
555569 // Find out if init is killed by the kernel's OOM killer.
You can’t perform that action at this time.
0 commit comments