From 114482ed9962f20da2af04e7778b1f99e85eb7b1 Mon Sep 17 00:00:00 2001 From: fupan Date: Fri, 6 Jul 2018 18:56:05 +0800 Subject: [PATCH] api: To stop its monitor after a sandbox paused After the sandbox is paused, it's needed to stop its monitor, Otherwise, its monitors will receive timeout errors if it is paused for a long time, thus its monitor will not tell it's a crash caused timeout or just a paused timeout. Fixes: #472 Signed-off-by: fupan --- virtcontainers/sandbox.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/virtcontainers/sandbox.go b/virtcontainers/sandbox.go index 87f8eda529..b289db5769 100644 --- a/virtcontainers/sandbox.go +++ b/virtcontainers/sandbox.go @@ -1203,6 +1203,14 @@ func (s *Sandbox) Pause() error { return err } + //After the sandbox is paused, it's needed to stop its monitor, + //Otherwise, its monitors will receive timeout errors if it is + //paused for a long time, thus its monitor will not tell it's a + //crash caused timeout or just a paused timeout. + if s.monitor != nil { + s.monitor.stop() + } + return s.pauseSetStates() }