From 21d7bb95ebde6ce2a0b4365d7be852c94efdf6ab Mon Sep 17 00:00:00 2001 From: Ted Yu Date: Fri, 3 Apr 2020 15:27:27 -0700 Subject: [PATCH] Close criuServer so that even if CRIU crashes or unexpectedly exits, runc will not hang Signed-off-by: Ted Yu --- libcontainer/container_linux.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libcontainer/container_linux.go b/libcontainer/container_linux.go index b02df818..40797434 100644 --- a/libcontainer/container_linux.go +++ b/libcontainer/container_linux.go @@ -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