Add basic deadlock detection for container start/remove

We can easily tell if we're going to deadlock by comparing lock
IDs before actually taking the lock. Add a few checks for this in
common places where deadlocks might occur.

This does not yet cover pod operations, where detection is more
difficult (and costly) due to the number of locks being involved
being higher than 2.

Also, add some error wrapping on the Podman side, so we can tell
people to use `system renumber` when it occurs.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
This commit is contained in:
Matthew Heon
2020-02-23 13:25:12 -05:00
parent 18dcb84d64
commit 4004f646cd
7 changed files with 32 additions and 3 deletions

View File

@ -36,9 +36,6 @@ func (r *Runtime) RemoveVolume(ctx context.Context, v *Volume, force bool) error
}
}
v.lock.Lock()
defer v.lock.Unlock()
return r.removeVolume(ctx, v, force)
}