Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ABBA deadlock in podman volume rm --force #23613

Closed
Luap99 opened this issue Aug 14, 2024 · 0 comments
Closed

ABBA deadlock in podman volume rm --force #23613

Luap99 opened this issue Aug 14, 2024 · 0 comments
Assignees
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.

Comments

@Luap99
Copy link
Member

Luap99 commented Aug 14, 2024

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 issue

Describe 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

@Luap99 Luap99 added the kind/bug Categorizes issue or PR as related to a bug. label Aug 14, 2024
@Luap99 Luap99 self-assigned this Aug 14, 2024
@stale-locking-app stale-locking-app bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Nov 14, 2024
@stale-locking-app stale-locking-app bot locked as resolved and limited conversation to collaborators Nov 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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.
Projects
None yet
Development

No branches or pull requests

1 participant