From 5b50b34df4dc4afa02a5684fe9d13eef315342bb Mon Sep 17 00:00:00 2001 From: Peng Tao Date: Tue, 13 Aug 2019 03:37:49 -0700 Subject: [PATCH] shimv2: cancel monitor before stopping sandbox So that we don't trigger sandbox watcher on our own. Signed-off-by: Peng Tao --- containerd-shim-v2/wait.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/containerd-shim-v2/wait.go b/containerd-shim-v2/wait.go index 11a88c9d22..7b5e80f6a6 100644 --- a/containerd-shim-v2/wait.go +++ b/containerd-shim-v2/wait.go @@ -53,6 +53,10 @@ func wait(s *service, c *container, execID string) (int32, error) { // sandbox. if c.cType.IsSandbox() { + // cancel watcher + if s.monitor != nil { + s.monitor <- nil + } if err = s.sandbox.Stop(true); err != nil { logrus.WithField("sandbox", s.sandbox.ID()).Error("failed to stop sandbox") }