diff --git a/containerd.spec b/containerd.spec index 6810093f49a8599acab8b98e51253af8a83a97d1..010a0783e3912faafad9840852bd9b5fdadb2bad 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 19b166acbfe0f15a8c1f7d8cd64f4319250354de..cd8ad28e58be27e63dd290b10ee5e9033f4ebd5d 100644 --- a/git-commit +++ b/git-commit @@ -1 +1 @@ -c348b5745e13bc7873ac8a960e4fb9a4405263d6 +ce9edd5049a834b799e3f343f42e4e4fa89adc9d diff --git a/patch/0043-containerd-fix-dead-loop.patch b/patch/0043-containerd-fix-dead-loop.patch new file mode 100644 index 0000000000000000000000000000000000000000..c9a380681906f6d4679e0ee920a25764beab7cc2 --- /dev/null +++ b/patch/0043-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 b6d6e3400bff19944e7bf3cc821d3c6084ed77e0..5c2a0f7fd9613c3b9cfc26d8964cd95a133eae9e 100644 --- a/series.conf +++ b/series.conf @@ -39,3 +39,4 @@ patch/0039-containerd-client-fix-returned-error-in-the-defer-function.patch patch/0040-containerd-do-not-report-error-log-when-skip-otlp-pl.patch patch/0041-containerd-execute-delayKill-when-fd-is-exhausted.patch patch/0042-containerd-delete-task-asynchronously-to-avoid-conta.patch +patch/0043-containerd-fix-dead-loop.patch