diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-06-25 15:43:17 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-06-25 15:43:17 -0700 |
commit | e5526f4f2696a2334d61b05f31ad23b7bee4342b (patch) | |
tree | 537f2f2c048137c2483b94c127059cbaf54dd642 /runsc/sandbox | |
parent | f00077e8d8d59ee6db93a3ece24c5f3f5156eda5 (diff) | |
parent | d703340bc04a4269f420fdf24d946abcbc6a620b (diff) |
Merge pull request #6222 from avagin:stop
PiperOrigin-RevId: 381561785
Diffstat (limited to 'runsc/sandbox')
-rw-r--r-- | runsc/sandbox/sandbox.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/runsc/sandbox/sandbox.go b/runsc/sandbox/sandbox.go index 29e202b7d..f14cc7229 100644 --- a/runsc/sandbox/sandbox.go +++ b/runsc/sandbox/sandbox.go @@ -797,7 +797,13 @@ func (s *Sandbox) Wait(cid string) (unix.WaitStatus, error) { // Try the Wait RPC to the sandbox. var ws unix.WaitStatus err = conn.Call(boot.ContainerWait, &cid, &ws) + conn.Close() if err == nil { + if s.IsRootContainer(cid) { + if err := s.waitForStopped(); err != nil { + return unix.WaitStatus(0), err + } + } // It worked! return ws, nil } |