From 43c9d470cfcfa4b813bc5d98cbb44e302711c72f Mon Sep 17 00:00:00 2001 From: allencloud Date: Tue, 4 Oct 2016 10:29:21 +0800 Subject: [PATCH] add lock in libcontainerd client AddProcess of Windows Signed-off-by: allencloud Upstream-commit: 5143be0ccf70c7cb2acc2aa39fd7ec47450e5daa Component: engine --- components/engine/daemon/daemon.go | 2 +- components/engine/libcontainerd/client_windows.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/components/engine/daemon/daemon.go b/components/engine/daemon/daemon.go index 9911f3d2a3..8e90378b40 100644 --- a/components/engine/daemon/daemon.go +++ b/components/engine/daemon/daemon.go @@ -669,7 +669,7 @@ func NewDaemon(config *Config, registryService registry.Service, containerdRemot 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 { return nil, err } diff --git a/components/engine/libcontainerd/client_windows.go b/components/engine/libcontainerd/client_windows.go index 86dd9c60de..1e833ce862 100644 --- a/components/engine/libcontainerd/client_windows.go +++ b/components/engine/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 if err := clnt.backend.AttachStreams(processFriendlyName, *iopipe); err != nil { + clnt.lock(containerID) return err }