From dfbe86042987a6f5c14c589668183f37d2ecac91 Mon Sep 17 00:00:00 2001
From: zhongjiawei <zhongjiawei1@huawei.com>
Date: Mon, 17 Oct 2022 16:21:01 +0800
Subject: [PATCH] runc: reduce max number of retries to 10

[Changelog]:when killing containers in D state, now runc will do
100 retries, which leads that containerd blocks for 10 seconds.
[Author]:Ruilin Li
---
 runc-1.1.3/delete.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/runc-1.1.3/delete.go b/runc-1.1.3/delete.go
index 746b0df..799c2a7 100644
--- a/runc-1.1.3/delete.go
+++ b/runc-1.1.3/delete.go
@@ -14,8 +14,8 @@ import (
 )
 
 func killContainer(container libcontainer.Container) error {
-	_ = container.Signal(unix.SIGKILL, false)
-	for i := 0; i < 100; i++ {
+	container.Signal(unix.SIGKILL, false)
+	for i := 0; i < 10; i++ {
 		time.Sleep(100 * time.Millisecond)
 		if err := container.Signal(unix.Signal(0), false); err != nil {
 			destroy(container)
-- 
2.30.0

