Skip to content

[release/2.3] runtime: invoke Shutdown after every task deletion - #14636

Merged
mikebrow merged 1 commit into
containerd:release/2.3from
k8s-infra-cherrypick-robot:cherry-pick-13958-to-release/2.3
Nov 24, 2026
Merged

mikebrow merged 1 commit into
containerd:release/2.3from
k8s-infra-cherrypick-robot:cherry-pick-13958-to-release/2.3

Conversation

@k8s-infra-cherrypick-robot

Copy link
Copy Markdown

This is an automated cherry-pick of #13958

/assign mxpv

Ensure grouped shims receive shutdown when the last active task is deleted

TaskService.Shutdown may be invoked multiple times. A grouped shim
itself does not terminate while it still has active tasks. It terminates only
after receiving a Shutdown request when no active tasks remain.

The shim manager should invoke TaskService.Shutdown after deleting every task,
regardless of whether the task represents sandbox or not. This ensures that the
shim receives Shutdown when the last active task is deleted.

In CRI, the pause container uses oom_score_adj=-998, making it unlikely to be
OOM-killed. However, it may still exit or be killed before the other containers
in the sandbox. SandboxService.Shutdown and TaskService.Shutdown are independent
APIs. Sandbox service should make sure there is no active containers
before shutdown. So, for the task service, we should invoke Shutdown for
each task.

Removing the supportSandboxAPIVersion check does not change behavior for shims
using task API versions below v3. Those shims were already forced down the
non-sandboxed path and received Shutdown after every task deletion. The behavior
change applies only to sandboxed tasks using task API v3, which now receive
Shutdown after deletion as well.

Signed-off-by: Wei Fu <[email protected]>
@github-project-automation github-project-automation Bot moved this from Needs Triage to Review In Progress in Pull Request Review Nov 24, 2026
@mikebrow
mikebrow merged commit 7d8f418 into containerd:release/2.3 Nov 24, 2026
83 of 88 checks passed
@github-project-automation github-project-automation Bot moved this from Review In Progress to Done in Pull Request Review Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

5 participants