瀏覽代碼

Fix daemon panic on restoring containers

Signed-off-by: Lei Jitang <leijitang@huawei.com>
(cherry picked from commit c75de8e33cc0db5236eef6146f2de06533b46aa8)
Signed-off-by: Tibor Vass <tibor@docker.com>
Lei Jitang 9 年之前
父節點
當前提交
c46db363d6
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      libcontainerd/client_linux.go

+ 2 - 0
libcontainerd/client_linux.go

@@ -563,6 +563,8 @@ func (clnt *client) Restore(containerID string, options ...CreateOption) error {
 		clnt.remote.Lock()
 		clnt.remote.Lock()
 		return nil
 		return nil
 	}
 	}
+	// relock because of the defer
+	clnt.remote.Lock()
 
 
 	clnt.deleteContainer(containerID)
 	clnt.deleteContainer(containerID)