Close criuServer so that even if CRIU crashes or unexpectedly exits, runc will not hang

Signed-off-by: Ted Yu <yuzhihong@gmail.com>
This commit is contained in:
Ted Yu 2020-04-03 15:27:27 -07:00
parent e4363b0387
commit 21d7bb95eb
1 changed files with 2 additions and 0 deletions

View File

@ -1498,6 +1498,8 @@ func (c *linuxContainer) criuSwrk(process *Process, req *criurpc.CriuReq, opts *
if err := cmd.Start(); err != nil {
return err
}
// we close criuServer so that even if CRIU crashes or unexpectedly exits, runc will not hang.
criuServer.Close()
// cmd.Process will be replaced by a restored init.
criuProcess := cmd.Process