Skip to content

core/runtime/v2: add timeout to shim.delete during loadShims - #13852

Closed
HarshalPatel1972 wants to merge 2 commits into
containerd:mainfrom
HarshalPatel1972:fix-loadshims-hang
Closed

HarshalPatel1972 wants to merge 2 commits into
containerd:mainfrom
HarshalPatel1972:fix-loadshims-hang

Conversation

@HarshalPatel1972

Copy link
Copy Markdown
Contributor

Fixes #13848

when loadShims cleans up abandoned shims during daemon startup, it calls shim.delete() using the daemon's startup context. this context doesn't have a deadline.

if a single leftover shim process never replies to the Delete grpc request (like what happens in #13848), containerd just hangs forever on startup.

this wraps the context with the existing cleanupTimeout (5s) before deleting the shim, ensuring the daemon can recover and continue starting even if a shim is wedged.

Fixes containerd#13848

When loadShims cleans up abandoned shims during daemon startup, it calls
shim.delete() with the daemon's startup context, which lacks a deadline.
If a single leftover shim process never replies to the Delete gRPC
request, containerd hangs forever on startup.

This wraps the context with the existing cleanupTimeout (5s) to ensure
the daemon can recover and continue starting even if a shim is wedged.

Signed-off-by: Harshal Patel <[email protected]>
Signed-off-by: Harshal Patel <[email protected]>
@austinvazquez

Copy link
Copy Markdown
Member

Hi @HarshalPatel1972 , I was actually looking at a similar issue with loading a wedged / leaked shim preventing containerd startup in my use case. I authored #13954 and added you as a co-author since we were circling the same issue in my opinion.

@kubernetes-prow

Copy link
Copy Markdown

PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@github-project-automation github-project-automation Bot moved this from Needs Triage to Done in Pull Request Review Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

loadShims can hang forever at startup if a single leftover shim's Task.Delete never replies

2 participants