ABBA deadlock in podman volume rm --force #23613
Labels
kind/bug
Categorizes issue or PR as related to a bug.
locked - please file new issue/PR
Assist humans wanting to comment on an old issue or PR with locked comments.
Issue Description
When a volume is removed via podman volume rm --force and there containers with the volume it is trivial to run into deadlocks. The main issue is that most code paths get first the ctr lock and then the voluem lock while volume rm does the opposite so it causes ABBA deadlocks.
Steps to reproduce the issue
Terminal 1:
i=0; while :; do bin/podman run -v test:/test quay.io/libpod/testimage:20240123 sleep 0.1 && echo $i && i=$((i + 1)) || break; done
Terminal 2
i=0; while :; do bin/podman volume rm test --force && echo $i && i=$((i + 1)) || break; done
you may need to rerun the volume rm command a couple of times until you hit the deadlock because it can fail with
Error: removing volume test: volume test is in use by containers cb054c09134cfe08da758410a901c3897b5714202ab000713ad2e603eb694270: volume is being used
which is also another issueDescribe the results you received
Both commands deadlock
Describe the results you expected
volume should be deleted properly
podman info output
podman@main
Podman in a container
No
Privileged Or Rootless
None
Upstream Latest Release
Yes
Additional environment details
Additional environment details
Additional information
podman run is just one simple example to hit this. It happen with the container cleanup process as well which causes CI issue here: https://api.cirrus-ci.com/v1/artifact/task/6114089225682944/html/int-podman-fedora-39-root-container-boltdb.log.html#t--Podman-volume-create-image-backed-volume-force-removal--1
The text was updated successfully, but these errors were encountered: