Merge pull request #3124 from mheon/remove_pod_lock

When removing pods, free their locks
This commit is contained in:
OpenShift Merge Robot 2019-05-15 21:17:54 +02:00 committed by GitHub
commit 3057572fc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -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
}