Browse Source

add lock in libcontainerd client AddProcess of Windows

Signed-off-by: allencloud <allen.sun@daocloud.io>
allencloud 8 years ago
parent
commit
5143be0ccf
2 changed files with 2 additions and 1 deletions
  1. 1 1
      daemon/daemon.go
  2. 1 0
      libcontainerd/client_windows.go

+ 1 - 1
daemon/daemon.go

@@ -669,7 +669,7 @@ func NewDaemon(config *Config, registryService registry.Service, containerdRemot
 		return nil, err
 		return nil, err
 	}
 	}
 
 
-	// Plugin system initialization should happen before restore. Dont change order.
+	// Plugin system initialization should happen before restore. Do not change order.
 	if err := pluginInit(d, config, containerdRemote); err != nil {
 	if err := pluginInit(d, config, containerdRemote); err != nil {
 		return nil, err
 		return nil, err
 	}
 	}

+ 1 - 0
libcontainerd/client_windows.go

@@ -328,6 +328,7 @@ func (clnt *client) AddProcess(ctx context.Context, containerID, processFriendly
 
 
 	// Tell the engine to attach streams back to the client
 	// Tell the engine to attach streams back to the client
 	if err := clnt.backend.AttachStreams(processFriendlyName, *iopipe); err != nil {
 	if err := clnt.backend.AttachStreams(processFriendlyName, *iopipe); err != nil {
+		clnt.lock(containerID)
 		return err
 		return err
 	}
 	}