From 1735262dfdbc434c3e734c2a4b7e3c5407cd541f Mon Sep 17 00:00:00 2001
From: xiadanni1 <xiadanni1@huawei.com>
Date: Sat, 16 Nov 2019 02:28:31 +0800
Subject: [PATCH] containerd:  modify shim initiative exit time

reason: We set shim exit initiative after 3s of container init process
exiting, but poststop hook will run abnormally if it needs more than 3s.
So we modify the exit time to 120s to avoid this case, as poststop hook
is suggested not more than 120s.

Change-Id: I3e78b6344fabb0687bc40c3b6da153f403a9f211
Signed-off-by: xiadanni1 <xiadanni1@huawei.com>
---
 runtime/v1/shim/service.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/runtime/v1/shim/service.go b/runtime/v1/shim/service.go
index 3abaa99..9721660 100644
--- a/runtime/v1/shim/service.go
+++ b/runtime/v1/shim/service.go
@@ -549,7 +549,7 @@ func (s *Service) checkProcesses(e runc.Exit) {
 				events.ExitAddFile(ns, events.ExitFile(s.id, uint32(e.Pid), uint32(e.Status)), "init exited")
 				events.InitExitWrite(ip.Bundle, e.Pid)
 				go func() {
-					time.Sleep(3 * time.Second)
+					time.Sleep(120 * time.Second)
 					os.Exit(0)
 				}()
 			}
-- 
1.8.3.1

