Browse Source

Fix daemon panic on restoring containers

Signed-off-by: Lei Jitang <leijitang@huawei.com>
Lei Jitang 9 years ago
parent
commit
c75de8e33c
1 changed files with 2 additions and 0 deletions
  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)