From 7d435b84f0b0e60e1fbaed7d47de8744c33de78e Mon Sep 17 00:00:00 2001 From: Julio Montes Date: Wed, 30 May 2018 16:04:11 -0500 Subject: [PATCH] virtcontainers/api: use RW lock to update containers When a container is updated, those modifications are stored, to avoid race conditions with other operations, a RW lock should be used. fixes #346 Signed-off-by: Julio Montes --- virtcontainers/api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virtcontainers/api.go b/virtcontainers/api.go index 8302737e6f..82eea17c0e 100644 --- a/virtcontainers/api.go +++ b/virtcontainers/api.go @@ -615,7 +615,7 @@ func UpdateContainer(sandboxID, containerID string, resources specs.LinuxResourc return errNeedContainerID } - lockFile, err := rLockSandbox(sandboxID) + lockFile, err := rwLockSandbox(sandboxID) if err != nil { return err }