diff options
author | Matthew Heon <matthew.heon@pm.me> | 2019-02-15 09:34:37 -0500 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2019-02-21 10:51:42 -0500 |
commit | ca8ae877c12cbfa368d572ef6700d9e4a23d5b11 (patch) | |
tree | ff88667c11ccf69576a85fbccffab68fbc95b326 /libpod/runtime_renumber.go | |
parent | 9353a3e8ec3855f29c552dd1e0134dbaa3031efa (diff) | |
download | podman-ca8ae877c12cbfa368d572ef6700d9e4a23d5b11.tar.gz podman-ca8ae877c12cbfa368d572ef6700d9e4a23d5b11.tar.bz2 podman-ca8ae877c12cbfa368d572ef6700d9e4a23d5b11.zip |
Remove locks from volumes
I was looking into why we have locks in volumes, and I'm fairly
convinced they're unnecessary.
We don't have a state whose accesses we need to guard with locks
and syncs. The only real purpose for the lock was to prevent
concurrent removal of the same volume.
Looking at the code, concurrent removal ought to be fine with a
bit of reordering - one or the other might fail, but we will
successfully evict the volume from the state.
Also, remove the 'prune' bool from RemoveVolume. None of our
other API functions accept it, and it only served to toggle off
more verbose error messages.
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'libpod/runtime_renumber.go')
-rw-r--r-- | libpod/runtime_renumber.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libpod/runtime_renumber.go b/libpod/runtime_renumber.go index b27b5f1a8..d5279934e 100644 --- a/libpod/runtime_renumber.go +++ b/libpod/runtime_renumber.go @@ -12,6 +12,12 @@ import ( // It renders the runtime it is called on, and all container/pod/volume structs // from that runtime, unusable, and requires that a new runtime be initialized // after it is called. +// TODO: It would be desirable to make it impossible to call this until all +// other libpod sessions are dead. +// Possibly use a read-write file lock, with all non-renumber podmans owning the +// lock as read, renumber attempting to take a write lock? +// The alternative is some sort of session tracking, and I don't know how +// reliable that can be. func (r *Runtime) RenumberLocks() error { r.lock.Lock() locked := true |