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 <lifupan@gmail.com>
This commit is contained in:
fupan 2018-07-06 18:56:05 +08:00
parent b2bec3362b
commit 114482ed99

View File

@ -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()
}