1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #29015 from coolljt0725/fix_restore_panic

Fix docker restart panic on machine ungracefully shutdown
This commit is contained in:
Tõnis Tiigi 2016-12-01 08:38:02 -08:00 committed by GitHub
commit 0a5cb187b4

View file

@ -454,7 +454,7 @@ func (clnt *client) Restore(containerID string, attachStdio StdioCallback, optio
if err != nil {
logrus.Warnf("libcontainerd: failed to retrieve container %s state: %v", containerID, err)
}
if ev != nil && ev.Pid != InitFriendlyName || ev.Type != StateExit {
if ev != nil && (ev.Pid != InitFriendlyName || ev.Type != StateExit) {
// Wait a while for the exit event
timeout := time.NewTimer(10 * time.Second)
tick := time.NewTicker(100 * time.Millisecond)