mirror of
https://github.com/containerd/containerd.git
synced 2026-11-06 05:17:02 +00:00
When StartContainer fails after the task is created and the cleanup task delete fails (e.g. it timed out on a stuck shim), the container was still recorded as EXITED while its task remained. RemoveContainer only reaps tasks for RUNNING and UNKNOWN containers, so every kubelet GC retry failed with "cannot delete running task" and the container was never collected. Record the container as UNKNOWN when task cleanup cannot be confirmed so RemoveContainer force-stops it and retries the cleanup, keeping the StartError reason in both cases. Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>