mirror of
https://github.com/containers/podman.git
synced 2025-08-06 11:32:07 +08:00
When removing pods, free their locks
Without this we leak allocated locks, which is definitely not a good thing. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
This commit is contained in:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user