Browse code

add lock in libcontainerd client AddProcess

Signed-off-by: allencloud <allen.sun@daocloud.io>
(cherry picked from commit 278273bc1699873304240a6eca342b54051e2f23)
Signed-off-by: Victor Vieux <vieux@docker.com>

allencloud authored on 2016/10/02 01:22:23
Showing 2 changed files
... ...
@@ -101,6 +101,7 @@ func (clnt *client) AddProcess(ctx context.Context, containerID, processFriendly
101 101
 	clnt.unlock(containerID)
102 102
 
103 103
 	if err := clnt.backend.AttachStreams(processFriendlyName, *iopipe); err != nil {
104
+		clnt.lock(containerID)
104 105
 		return err
105 106
 	}
106 107
 	clnt.lock(containerID)
... ...
@@ -27,9 +27,9 @@ type Process struct {
27 27
 	Capabilities []string `json:"capabilities,omitempty"`
28 28
 	// Rlimits specifies rlimit options to apply to the process.
29 29
 	Rlimits []specs.Rlimit `json:"rlimits,omitempty"`
30
-	// ApparmorProfile specified the apparmor profile for the container.
30
+	// ApparmorProfile specifies the apparmor profile for the container.
31 31
 	ApparmorProfile *string `json:"apparmorProfile,omitempty"`
32
-	// SelinuxProcessLabel specifies the selinux context that the container process is run as.
32
+	// SelinuxLabel specifies the selinux context that the container process is run as.
33 33
 	SelinuxLabel *string `json:"selinuxLabel,omitempty"`
34 34
 }
35 35