Selaa lähdekoodia

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 8 vuotta sitten
vanhempi
commit
9975fcbe1c
2 muutettua tiedostoa jossa 3 lisäystä ja 2 poistoa
  1. 1 0
      libcontainerd/client_linux.go
  2. 2 2
      libcontainerd/types_linux.go

+ 1 - 0
libcontainerd/client_linux.go

@@ -101,6 +101,7 @@ func (clnt *client) AddProcess(ctx context.Context, containerID, processFriendly
 	clnt.unlock(containerID)
 	clnt.unlock(containerID)
 
 
 	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
 	}
 	}
 	clnt.lock(containerID)
 	clnt.lock(containerID)

+ 2 - 2
libcontainerd/types_linux.go

@@ -27,9 +27,9 @@ type Process struct {
 	Capabilities []string `json:"capabilities,omitempty"`
 	Capabilities []string `json:"capabilities,omitempty"`
 	// Rlimits specifies rlimit options to apply to the process.
 	// Rlimits specifies rlimit options to apply to the process.
 	Rlimits []specs.Rlimit `json:"rlimits,omitempty"`
 	Rlimits []specs.Rlimit `json:"rlimits,omitempty"`
-	// ApparmorProfile specified the apparmor profile for the container.
+	// ApparmorProfile specifies the apparmor profile for the container.
 	ApparmorProfile *string `json:"apparmorProfile,omitempty"`
 	ApparmorProfile *string `json:"apparmorProfile,omitempty"`
-	// SelinuxProcessLabel specifies the selinux context that the container process is run as.
+	// SelinuxLabel specifies the selinux context that the container process is run as.
 	SelinuxLabel *string `json:"selinuxLabel,omitempty"`
 	SelinuxLabel *string `json:"selinuxLabel,omitempty"`
 }
 }