diff --git a/containerd.spec b/containerd.spec index 130761c3395e1a0c41526cd9fde3262103b15594..03bef6cbea5dfa434451fad804e2ad96ae075c67 100644 --- a/containerd.spec +++ b/containerd.spec @@ -2,7 +2,7 @@ %global debug_package %{nil} Version: 1.6.22 Name: containerd -Release: 19 +Release: 20 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 +* Tue Jul 22 2025 dongyuzhen - 1.6.22-20 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:delete task asynchronously to avoid containerd be killed when delete is blocking + * Tue Jul 01 2025 dongyuzhen - 1.6.22-19 - Type:bugfix - ID:NA diff --git a/git-commit b/git-commit index f6081533186a1f3e3d5c6bfd343810a37813b975..09110e2ba6b2cf23d0c0dde4fb9b32d2766641a8 100644 --- a/git-commit +++ b/git-commit @@ -1 +1 @@ -2a93e293ef23be33747b03227e86cafd899f3930 +e3feb4b553c0adac6434c12e285842e3550be583 diff --git a/patch/0043-containerd-delete-task-asynchronously-to-avoid-conta.patch b/patch/0043-containerd-delete-task-asynchronously-to-avoid-conta.patch new file mode 100644 index 0000000000000000000000000000000000000000..761fbb968250fefbe9d7c8d3a92aa09bf83765db --- /dev/null +++ b/patch/0043-containerd-delete-task-asynchronously-to-avoid-conta.patch @@ -0,0 +1,43 @@ +From 7feb6554760b1090e4374f8d077819a834ba87e0 Mon Sep 17 00:00:00 2001 +From: zhongjiawei +Date: Tue, 17 Jun 2025 20:03:08 +0800 +Subject: [PATCH] containerd:delete task asynchronously to avoid containerd be + killed when delete is blocking + +--- + runtime/v1/linux/runtime.go | 13 ++++++++++--- + 1 file changed, 10 insertions(+), 3 deletions(-) + +diff --git a/runtime/v1/linux/runtime.go b/runtime/v1/linux/runtime.go +index ae36b7bd..18a0a40b 100644 +--- a/runtime/v1/linux/runtime.go ++++ b/runtime/v1/linux/runtime.go +@@ -495,15 +495,22 @@ func (r *Runtime) loadTasks(ctx context.Context, ns string) ([]*Task, error) { + continue + } + if pid <= 0 { +- log.G(ctx).Warnf("skip load task in creating %s", id) ++ go func() { ++ log.G(ctx).Infof("del task in creating %s", id) ++ t.DeleteForce(ctx, uint32(pid)) ++ log.G(ctx).Infof("del task in creating %s done", id) ++ }() + continue + } + if events.InitExitExist(bundle.path) { + if !events.ExitPending(ns, t.id, uint32(pid)) { + events.ExitAddFile(ns, events.ExitFile(t.id, uint32(pid), uint32(events.ExitStatusDefault)), "cleanup dirty task") + } +- _, err := t.DeleteForce(ctx, uint32(pid)) +- log.G(ctx).Warnf("delete force %s Pid=%d(exiting) error=%v", id, pid, err) ++ go func() { ++ log.G(ctx).Infof("delete force %s start, Pid=%d(exiting)", id, pid) ++ _, err := t.DeleteForce(ctx, uint32(pid)) ++ log.G(ctx).Infof("delete force %s done, Pid=%d(exiting) error=%v", id, pid, err) ++ }() + continue + } + log.G(ctx).Infof("load-task %s Pid=%d done", id, pid) +-- +2.33.0 + diff --git a/series.conf b/series.conf index 559715aa0248e7dcc30fcb6bc398f8a941638d0a..3b8083279fb8fcba1f70be4a03608c620a245ffb 100644 --- a/series.conf +++ b/series.conf @@ -39,3 +39,4 @@ patch/0039-containerd-Prevent-panic-in-Docker-pusher.patch 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