diff options
author | Matthew Heon <mheon@redhat.com> | 2022-02-22 11:05:26 -0500 |
---|---|---|
committer | Matthew Heon <mheon@redhat.com> | 2022-02-23 14:29:41 -0500 |
commit | 71b0909f2d71e542176a3e88111bf99c73d1f5cd (patch) | |
tree | 7fb7d7b2bbdf5120211b9f8c4d781c31fde593cc /libpod/runtime_cstorage.go | |
parent | ee7cf3cc2c212ff7a24bda49f95d494d99eb3cd7 (diff) | |
download | podman-71b0909f2d71e542176a3e88111bf99c73d1f5cd.tar.gz podman-71b0909f2d71e542176a3e88111bf99c73d1f5cd.tar.bz2 podman-71b0909f2d71e542176a3e88111bf99c73d1f5cd.zip |
Remove the runtime lock
This primarily served to protect us against shutting down the
Libpod runtime while operations (like creating a container) were
happening. However, it was very inconsistently implemented (a lot
of our longer-lived functions, like pulling images, just didn't
implement it at all...) and I'm not sure how much we really care
about this very-specific error case?
Removing it also removes a lot of potential deadlocks, which is
nice.
[NO NEW TESTS NEEDED]
Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'libpod/runtime_cstorage.go')
-rw-r--r-- | libpod/runtime_cstorage.go | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/libpod/runtime_cstorage.go b/libpod/runtime_cstorage.go index 026cab3c5..1c528e1b8 100644 --- a/libpod/runtime_cstorage.go +++ b/libpod/runtime_cstorage.go @@ -21,9 +21,6 @@ type StorageContainer struct { // ListStorageContainers lists all containers visible to c/storage. func (r *Runtime) ListStorageContainers() ([]*StorageContainer, error) { - r.lock.RLock() - defer r.lock.RUnlock() - finalCtrs := []*StorageContainer{} ctrs, err := r.store.Containers() @@ -61,15 +58,6 @@ func (r *Runtime) StorageContainer(idOrName string) (*storage.Container, error) // Accepts ID or full name of container. // If force is set, the container will be unmounted first to ensure removal. func (r *Runtime) RemoveStorageContainer(idOrName string, force bool) error { - r.lock.Lock() - defer r.lock.Unlock() - - return r.removeStorageContainer(idOrName, force) -} - -// Internal function to remove the container storage without -// locking the runtime. -func (r *Runtime) removeStorageContainer(idOrName string, force bool) error { targetID, err := r.store.Lookup(idOrName) if err != nil { if errors.Cause(err) == storage.ErrLayerUnknown { |