diff --git a/containerd.spec b/containerd.spec index 03bef6cbea5dfa434451fad804e2ad96ae075c67..3110cf5edafda2e55ac8fdf74378bb41aba9d2e6 100644 --- a/containerd.spec +++ b/containerd.spec @@ -2,7 +2,7 @@ %global debug_package %{nil} Version: 1.6.22 Name: containerd -Release: 20 +Release: 21 Summary: An industry-standard container runtime License: ASL 2.0 URL: https://containerd.io @@ -68,6 +68,12 @@ install -D -p -m 0644 %{S:7} %{buildroot}%{_sysconfdir}/containerd/config.toml %exclude %{_bindir}/containerd-stress %changelog +* Wed Jul 23 2025 dongyuzhen - 1.6.22-21 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:fix dead loop + * Tue Jul 22 2025 dongyuzhen - 1.6.22-20 - Type:bugfix - ID:NA diff --git a/git-commit b/git-commit index 09110e2ba6b2cf23d0c0dde4fb9b32d2766641a8..4cdbc79ac9f66a38a28b57670f3489544e334e88 100644 --- a/git-commit +++ b/git-commit @@ -1 +1 @@ -e3feb4b553c0adac6434c12e285842e3550be583 +505c543740cc9cd666836e5c541d60d5296fa6ee diff --git a/patch/0044-containerd-fix-dead-loop.patch b/patch/0044-containerd-fix-dead-loop.patch new file mode 100644 index 0000000000000000000000000000000000000000..c9a380681906f6d4679e0ee920a25764beab7cc2 --- /dev/null +++ b/patch/0044-containerd-fix-dead-loop.patch @@ -0,0 +1,27 @@ +From f6a17df6cdaeb9ae1474b2dfc43ff52026608ef4 Mon Sep 17 00:00:00 2001 +From: zhongjiawei +Date: Fri, 4 Jul 2025 16:36:42 +0800 +Subject: [PATCH] containerd: fix dead loop + +when we kill shim process,will attach shim pid to wait shim exit +successful. However, if a new process reuses the pid of the shim process after the shim process exits before attach, it will cause dead loop. +--- + runtime/v1/shim/client/client.go | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/runtime/v1/shim/client/client.go b/runtime/v1/shim/client/client.go +index fdbc1964..ef6fea13 100644 +--- a/runtime/v1/shim/client/client.go ++++ b/runtime/v1/shim/client/client.go +@@ -433,7 +433,7 @@ func (c *Client) waitForExit(ctx context.Context, pid int) <-chan struct{} { + ticker := time.NewTicker(10 * time.Millisecond) + defer ticker.Stop() + +- for { ++ for i := 0; i < 1000; i++ { + // use kill(pid, 0) here because the shim could have been reparented + // and we are no longer able to waitpid(pid, ...) on the shim + if err := unix.Kill(pid, 0); err == unix.ESRCH { +-- +2.33.0 + diff --git a/series.conf b/series.conf index 3b8083279fb8fcba1f70be4a03608c620a245ffb..178a7d990c0860a3a761b31439bea1cd9ecfe0a6 100644 --- a/series.conf +++ b/series.conf @@ -40,3 +40,4 @@ patch/0040-containerd-client-fix-returned-error-in-the-defer-function.patch patch/0041-containerd-do-not-report-error-log-when-skip-otlp-pl.patch patch/0042-containerd-execute-delayKill-when-fd-is-exhausted.patch patch/0043-containerd-delete-task-asynchronously-to-avoid-conta.patch +patch/0044-containerd-fix-dead-loop.patch