mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Handle paused container when restoring without live-restore set
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
parent
705e031b98
commit
c458d3bb98
1 changed files with 10 additions and 0 deletions
|
@ -523,8 +523,18 @@ func (clnt *client) Restore(containerID string, attachStdio StdioCallback, optio
|
||||||
if err := clnt.Signal(containerID, int(syscall.SIGTERM)); err != nil {
|
if err := clnt.Signal(containerID, int(syscall.SIGTERM)); err != nil {
|
||||||
logrus.Errorf("libcontainerd: error sending sigterm to %v: %v", containerID, err)
|
logrus.Errorf("libcontainerd: error sending sigterm to %v: %v", containerID, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Let the main loop handle the exit event
|
// Let the main loop handle the exit event
|
||||||
clnt.remote.Unlock()
|
clnt.remote.Unlock()
|
||||||
|
|
||||||
|
if ev != nil && ev.Type == StatePause {
|
||||||
|
// resume container, it depends on the main loop, so we do it after Unlock()
|
||||||
|
logrus.Debugf("libcontainerd: %s was paused, resuming it so it can die", containerID)
|
||||||
|
if err := clnt.Resume(containerID); err != nil {
|
||||||
|
return fmt.Errorf("failed to resume container: %v", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
select {
|
select {
|
||||||
case <-time.After(10 * time.Second):
|
case <-time.After(10 * time.Second):
|
||||||
if err := clnt.Signal(containerID, int(syscall.SIGKILL)); err != nil {
|
if err := clnt.Signal(containerID, int(syscall.SIGKILL)); err != nil {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue