shimv2: cancel monitor before stopping sandbox

So that we don't trigger sandbox watcher on our own.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
This commit is contained in:
Peng Tao 2019-08-13 03:37:49 -07:00
parent 49184ee562
commit 5b50b34df4

View File

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