浏览代码

Merge pull request #29015 from coolljt0725/fix_restore_panic

Fix docker restart panic on machine ungracefully shutdown
Tõnis Tiigi 8 年之前
父节点
当前提交
0a5cb187b4
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      libcontainerd/client_linux.go

+ 1 - 1
libcontainerd/client_linux.go

@@ -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)