summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-05-15 21:17:54 +0200
committerGitHub <noreply@github.com>2019-05-15 21:17:54 +0200
commit3057572fc1d7955fd0425c1a478c58d5e2488f53 (patch)
tree59d93b625c2f7fdfcd3c3c2606df3e05fb94f5fb /libpod
parent000106ce38bed2af2f850419d6b658b7e428d05d (diff)
parent7b4f6f573dd1b583b58c45cfef93c00ee3581051 (diff)
downloadpodman-3057572fc1d7955fd0425c1a478c58d5e2488f53.tar.gz
podman-3057572fc1d7955fd0425c1a478c58d5e2488f53.tar.bz2
podman-3057572fc1d7955fd0425c1a478c58d5e2488f53.zip
Merge pull request #3124 from mheon/remove_pod_lock
When removing pods, free their locks
Diffstat (limited to 'libpod')
-rw-r--r--libpod/runtime_pod_linux.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/libpod/runtime_pod_linux.go b/libpod/runtime_pod_linux.go
index 456ad365f..124d0daf8 100644
--- a/libpod/runtime_pod_linux.go
+++ b/libpod/runtime_pod_linux.go
@@ -308,5 +308,15 @@ func (r *Runtime) removePod(ctx context.Context, p *Pod, removeCtrs, force bool)
// Mark pod invalid
p.valid = false
p.newPodEvent(events.Remove)
+
+ // Deallocate the pod lock
+ if err := p.lock.Free(); err != nil {
+ if removalErr == nil {
+ removalErr = errors.Wrapf(err, "error freeing pod %s lock", p.ID())
+ } else {
+ logrus.Errorf("Error freeing pod %s lock: %v", p.ID(), err)
+ }
+ }
+
return removalErr
}