Merge pull request #409 from sameo/topic/fat-lock

Serialize Update and Sandbox/Container creation operations
This commit is contained in:
Antonio Murdaca 2017-04-04 23:23:19 +02:00 committed by GitHub
commit 3c7f3ab2ec
3 changed files with 22 additions and 12 deletions

View file

@ -230,6 +230,10 @@ func ensureSaneLogPath(logPath string) error {
func (s *Server) CreateContainer(ctx context.Context, req *pb.CreateContainerRequest) (res *pb.CreateContainerResponse, err error) {
logrus.Debugf("CreateContainerRequest %+v", req)
s.Update()
s.updateLock.RLock()
defer s.updateLock.RUnlock()
sbID := req.PodSandboxId
if sbID == "" {
return nil, fmt.Errorf("PodSandboxId should not be empty")