Repository navigation
Description
Description
What happened
An unplanned power outage caused an abrupt shutdown of all 4 nodes simultaneously. On power restoration, containerd restarted on every node before the CNI plugins multus and flannel were ready.
On startup, containerd reconnected to orphan shims from pre-outage DaemonSet sandbox containers and those shims immediately attempted CmdDel cleanup against /run/multus/multus.sock, which did not exist yet. The CmdDel call appears to block indefinitely with no observable timeout. All shims entered futex_wait_queue and remained blocked. containerd kept ttrpc connections open to these blocked shims without apparent recovery or garbage collection, resulting in persistent DeadlineExceeded on kubelet CRI calls on every node for 25 days until manual intervention.
The control plane node was recovered first but without captured forensic output due to terminal session loss. Full evidence was captured on the 3 worker nodes which remained in the blocked state at the time of documentation. Given that all nodes run the same containerd version and CNI stack and experienced the same outage conditions, the behavior is expected to be identical across all 4.
What I expected
A timeout error and clean failure, or containerd detecting stuck shims and recovering automatically. Instead the shims blocked indefinitely with no recovery path and no indication in the logs that the state was unrecoverable.
Confirmed evidence — 3 independent worker nodes
wchan — indefinite kernel wait on all 4 shims per node
for pid in $(sudo pgrep -f containerd-shim); do
wchan=$(sudo cat /proc/$pid/wchan 2>/dev/null)
[ -n "$wchan" ] && echo "PID $pid: $wchan"
done# k8s-w-5gccp
PID 1145: futex_wait_queue
PID 1147: futex_wait_queue
PID 1172: futex_wait_queue
PID 1208: futex_wait_queue
# k8s-w-5gcup
PID 1135: futex_wait_queue_me
PID 1195: futex_wait_queue_me
PID 1219: futex_wait_queue_me
PID 1229: futex_wait_queue_me
# k8s-w-obs
PID 1188: futex_wait_queue
PID 1190: futex_wait_queue
PID 1237: futex_wait_queue
PID 1264: futex_wait_queue
4 ttrpc connections never closed (per node)
sudo ss -xp | grep containerd.sock.ttrpcu_str ESTAB /run/containerd/containerd.sock.ttrpc users:(("containerd",pid=707,fd=34))
u_str ESTAB /run/containerd/containerd.sock.ttrpc users:(("containerd",pid=707,fd=35))
u_str ESTAB /run/containerd/containerd.sock.ttrpc users:(("containerd",pid=707,fd=49))
u_str ESTAB /run/containerd/containerd.sock.ttrpc users:(("containerd",pid=707,fd=50))
crictl DeadlineExceeded on every call
time sudo crictl --runtime-endpoint unix:///run/containerd/containerd.sock infoFATA[0002] getting status of runtime: rpc error: code = DeadlineExceeded
real 0m2.012s
Consistent across all 3 nodes.
Critical log — CmdDel race window confirmed at millisecond precision
10:36:13.119Z containerd connects to 4 orphan shims via ttrpc
10:36:13Z [error] CmdDel (shim): dial unix /run/multus/multus.sock:
connect: no such file or directory [x10]
10:36:13.192Z install-multus-binary container created ← 73ms after CmdDel
10:36:14.826Z kube-flannel container created ← 1.7s after CmdDel
The shims attempted cleanup before the CNI containers existed.
The socket became available too late — the shims were already blocked.
Orphan sandbox identity — same 4 DaemonSets on every node
for id in $(sudo pgrep -af containerd-shim | grep -oP '\-id \K[a-f0-9]+'); do
sudo ctr -n k8s.io containers info $id 2>/dev/null | \
grep -E 'pod.name|pod.namespace|cri-containerd.kind'
done
Same result on all 3 nodes — all standard Kubernetes infrastructure
DaemonSets, no specialized workloads involved:
kube-proxy, prometheus-node-exporter, kube-multus-ds, kube-flannel-ds
Cross-node summary
| Node | Containerd PID | wchan | ttrpc blocked | Orphan sandboxes |
|---|---|---|---|---|
| k8s-w-5gccp | 707 | futex_wait_queue |
4 | kube-proxy, node-exporter, kube-multus-ds, kube-flannel-ds |
| k8s-w-5gcup | 753 | futex_wait_queue_me |
4 | kube-proxy, node-exporter, kube-multus-ds, kube-flannel-ds |
| k8s-w-obs | 706 | futex_wait_queue |
4 | kube-proxy, node-exporter, kube-multus-ds, kube-flannel-ds |
futex_wait_queue and futex_wait_queue_me reflect different moments
of the same kernel wait path — entry and sustained steady-state.
Potentially relevant code path (hypothesis)
internal/cri/server/sandbox_stop.go — teardownPodNetwork:
err = netPlugin.Remove(ctx, id, path, opts...)If ctx has no deadline during shim reconnection at startup, this call may block indefinitely when the CNI socket is unavailable. This is a hypothesis based on observed behavior — not verified at the code level. Happy to be corrected on this.
Introspection attempt
Goroutine-level inspection was attempted but pprof was not available
in this production binary:
sudo nsenter -t 707 -n curl -v http://localhost:35169/debug/pprof/goroutine?debug=2
# HTTP/1.1 404 Not Found — no pprof handlers registeredThe presumed goroutine retention in containerd's event loop is inferred from observed behavior and Go's M:N scheduler model. Direct confirmation was not possible without recompiling with debug flags.
Workaround applied
# /etc/systemd/system/containerd.service under [Service]
ExecStartPost=/bin/sh -c 'until [ -S /run/multus/multus.sock ] && \
[ -f /run/flannel/subnet.env ]; do sleep 1; done'Related commit
Commit 0b84719 ("fix issue where cni del is never executed", merged in v2.3.0-rc.1) addresses a related but distinct case where CNIResult is nil and teardown is skipped. The scenario here occurs when CNIResult is present and teardown is attempted but the call blocks indefinitely on an unavailable socket. Both affect the same code path but appear to be different failure modes — happy to be corrected if I'm wrong about this distinction.
Questions for maintainers
- Should
netPlugin.RemoveinteardownPodNetworkenforce a
bounded timeout to prevent indefinite blocking on unavailable
CNI sockets? - Should containerd detect shims stuck in blocking syscalls at
startup and force-terminate them rather than keeping ttrpc
connections open indefinitely? - Is there an existing recovery mechanism for this scenario that
I may have missed in this deployment?
Full forensic report and log artifacts
Steps to reproduce the issue
- Kubernetes cluster with Flannel + Multus as meta-CNI
- Force abrupt power loss on all nodes (no graceful drain)
- Power on — containerd restarts before CNI plugins initialize
- Orphan shims from pre-outage DaemonSet sandboxes attempt CmdDel
against /run/multus/multus.sock which does not exist yet - Shims enter futex_wait_queue indefinitely, containerd gRPC becomes
unresponsive to kubelet
Describe the results you received and expected
Received: shims blocked indefinitely in futex_wait_queue, 4 ttrpc
connections never closed, kubelet DeadlineExceeded on every CRI call
for 25 days.
Expected: timeout error and clean failure, or automatic detection and
recovery of stuck shims.
What version of containerd are you using?
v2.0.1 (commit: 88aa2f5)
Any other relevant information
runc:
runc version 1.2.3
commit: v1.2.3-0-g0d37cfd4
spec: 1.2.0
go: go1.22.10
libseccomp: 2.5.5
uname -a:
Linux k8s-w-5gccp 6.8.0-106-generic #106-Ubuntu SMP x86_64 GNU/Linux
Full forensic report and log artifacts:
https://github.com/lpoclin/casebook/tree/main/incidents/INC-2026-002-containerd-runtime-failure
Show configuration if it is related to CRI plugin.
Standard containerd CRI config, no custom modifications.
CNI: /etc/cni/net.d/ — multus-shim as primary entry point,
flannel as clusterNetwork for eth0.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone

Activity
MikeZappa87 commentedon Apr 30, 2026
Did Multus and flannel ever come up? I can't tell if those pods didn't come up or something was blocking them from coming up as those are responsible for cleaning up with the CNI DEL.
samuelkarp commentedon Apr 30, 2026
Please don't dump giant walls of LLM output into issues without reading them critically.
If there was a power loss, there would be no existing running shims to connect to.
This version of containerd was released in December, 2024. It is very old. The latest patch version on the 2.0 branch is 2.0.8. Additionally, 2.0 has entered a more limited support phase focused on use-cases with GKE. GKE does not use multus or flannel. I would recommend upgrading to a current supported version of containerd such as 2.2.3.
lpoclin commentedon Apr 30, 2026
Correct, "reconnected" was inaccuarate on my part. I will upgrade to 2.2.3 and test whether the behavior persists.
lpoclin commentedon Apr 30, 2026
@MikeZappa87 Yes, Multus and Flannel came up successfully, the issue was that containerd spawned new shims to handle orphaned containers, and those shims attempted CmdDel before the multus socket was available. Once the socket became available the shims were already blocked in futex_wait_queue and never retried cleanup.
MikeZappa87 commentedon Apr 30, 2026
Should this be closed? It looks like everything worked as intended?
samuelkarp commentedon Apr 30, 2026
Shims don't call CNI DEL. The containerd daemon calls the CNI plugin.
ningmingxiao commentedon May 2, 2026
can you kill -10
pidof containerd(save stack at /tmp/ )and kill -10shimpid(print stack into containerd log) may print the stack we can see whereis hanging @lpoclinlpoclin commentedon May 2, 2026
@ningmingxiao Unfortunately I had to recover the cluster due to urgency, but I’ll upgrade to v2.2.3 and try to reproduce the issue and share any findings.
lpoclin commentedon May 6, 2026
Reproduced the outage scenario on v2.2.3 (commit 77c8424).
On restart, containerd logs "Start recovering state" and successfully completes "TearDown" for orphaned sandboxes, gRPC ok and ttrpc connections are properly cleaned up on restart
Closing.
Logs (v2.2.3):
ThePlenkov commentedon Jul 25, 2026
Related: containerd-shim zombie state on Docker Desktop / WSL2 — different trigger, same symptom
Not a CNI issue, but same core problem: shims block indefinitely on
futex_wait_queuewith no recovery path, causing all Docker API calls to those containers to hang forever.Environment
e53c7c1)What happened
4 LiteLLM containers (separate compose projects, shared Postgres/Redis) entered a state where:
containerd-shim-runc-v2processes remained alive inS (sleeping)state onfutex_do_wait/proc/$pid/task/*/children)docker psshowedrunning (unhealthy)stop,kill,rm -f,inspect,logs,top,statsdocker statsshowed-- / --for resource usage (daemon couldn't read cgroup metrics)Evidence from inside Docker Desktop VM
Timeline from Docker Desktop backend logs
compose/v5.3.1stops 2 non-litellm containers — completes in 4 seccompose/v5.3.1sendsPOST /stopto container v2 — no response everPOST /stopto container v3 — no responsePOST /kill?signal=KILLto container v2 — no responseexit status 1POST /stopto container v5 — no responseThe containers became zombies before any stop/kill attempt — the stop at 14:57:11 hung immediately, meaning the shims were already in degenerate state.
How this differs from #13326
Resolution
Only
kill -9on the zombie shim PIDs from inside the VM resolved it. The daemon then reconciled the container state (markedExited (255)) and normal operations resumed.Suggested improvement
The shim should detect when its child process set becomes empty and emit a task-exit event rather than blocking indefinitely. Alternatively, the daemon could implement a watchdog that periodically checks if running shims still have live children, and force-reconciles if they don't.