Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c458d3b

Browse files
committedMar 9, 2017
Handle paused container when restoring without live-restore set
Signed-off-by: Kenfe-Mickael Laventure <[email protected]>
1 parent 705e031 commit c458d3b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
 

‎libcontainerd/client_linux.go

+10
Original file line numberDiff line numberDiff line change
@@ -523,8 +523,18 @@ func (clnt *client) Restore(containerID string, attachStdio StdioCallback, optio
523523
if err := clnt.Signal(containerID, int(syscall.SIGTERM)); err != nil {
524524
logrus.Errorf("libcontainerd: error sending sigterm to %v: %v", containerID, err)
525525
}
526+
526527
// Let the main loop handle the exit event
527528
clnt.remote.Unlock()
529+
530+
if ev != nil && ev.Type == StatePause {
531+
// resume container, it depends on the main loop, so we do it after Unlock()
532+
logrus.Debugf("libcontainerd: %s was paused, resuming it so it can die", containerID)
533+
if err := clnt.Resume(containerID); err != nil {
534+
return fmt.Errorf("failed to resume container: %v", err)
535+
}
536+
}
537+
528538
select {
529539
case <-time.After(10 * time.Second):
530540
if err := clnt.Signal(containerID, int(syscall.SIGKILL)); err != nil {

0 commit comments

Comments
 (0)
Please sign in to comment.