aboutsummaryrefslogtreecommitdiff
path: root/libpod/container_internal.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-02-25 13:17:12 +0100
committerGitHub <noreply@github.com>2020-02-25 13:17:12 +0100
commit6babc9f20ca9e3633da1792a31d0391bde6201b6 (patch)
tree9627ab8a289952c5902ef45a09fab6cfbd143954 /libpod/container_internal.go
parent8a30759b6b7f73c76c90e0931e6cf1ca3d94ee61 (diff)
parent4004f646cd7a99f86b2098587c256071a89a4dc7 (diff)
downloadpodman-6babc9f20ca9e3633da1792a31d0391bde6201b6.tar.gz
podman-6babc9f20ca9e3633da1792a31d0391bde6201b6.tar.bz2
podman-6babc9f20ca9e3633da1792a31d0391bde6201b6.zip
Merge pull request #5305 from mheon/check_for_common_deadlocks
Add basic deadlock detection for container start/remove
Diffstat (limited to 'libpod/container_internal.go')
-rw-r--r--libpod/container_internal.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go
index 11f9721dc..ff43bfc8f 100644
--- a/libpod/container_internal.go
+++ b/libpod/container_internal.go
@@ -1401,6 +1401,9 @@ func (c *Container) mountNamedVolume(v *ContainerNamedVolume, mountpoint string)
return nil, errors.Wrapf(err, "error retrieving named volume %s for container %s", v.Name, c.ID())
}
+ if vol.config.LockID == c.config.LockID {
+ return nil, errors.Wrapf(define.ErrWillDeadlock, "container %s and volume %s share lock ID %d", c.ID(), vol.Name(), c.config.LockID)
+ }
vol.lock.Lock()
defer vol.lock.Unlock()
if vol.needsMount() {