-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Deadlock when RestartPolicy is used #14921
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.
stale-issue
Comments
I tried to add lock for Pod before locking container and this bug is not reproduces. But it's dirty hack to check my theory. |
I'll look at this today. |
tyler92
added a commit
to tyler92/podman
that referenced
this issue
Jul 19, 2022
There was a deadlock between two concurrent processes: play kube and cleanup, that is called after container exit when RestartPolicy is used. Before the fix, the cleanup command didn't lock Pod's lock, so there was a possibility of obtaining two locks in different order in two processes. [NO NEW TESTS NEEDED] Closes containers#14921 Signed-off-by: Mikhail Khachayants <[email protected]>
This was referenced Jul 19, 2022
tyler92
added a commit
to tyler92/podman
that referenced
this issue
Jul 19, 2022
There was a deadlock between two concurrent processes: play kube and cleanup, that is called after container exit when RestartPolicy is used. Before the fix, the cleanup command didn't lock Pod's lock, so there was a possibility of obtaining two locks in different order in two processes. [NO NEW TESTS NEEDED] Closes containers#14921 Signed-off-by: Mikhail Khachayants <[email protected]>
A friendly reminder that this issue had no activity for 30 days. |
This issue is not reproduced now with the 'main' branch. But I still have other deadlocks, I'll report separate issues. Thanks. |
github-actions
bot
added
the
locked - please file new issue/PR
Assist humans wanting to comment on an old issue or PR with locked comments.
label
Sep 19, 2023
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.
stale-issue
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
Sometimes podman is unable to do anything, even
podman info
. It is caused if there is any container with RestartPolicy=Always, that is restarting very often. It looks like deadlock and I've investigated it.Steps to reproduce the issue:
Describe the results you received:
The script hangs and does not exit.
Describe the results you expected:
The script will exit with success exit code.
Additional information you deem important (e.g. issue happens only occasionally):
This issue happens occasionally and probability depends on restarts rate. Also, I added log messages to SHMLock::Lock and SHMLock::Unlock functions (before and after operations) and what I got:
So, first process locked Lock 1 and trying to lock Lock 2, but second process locked Lock 2 and trying to lock Lock 1. Two mutexes are locking in inverse order.
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)
Yes
Additional environment details (AWS, VirtualBox, physical, etc.):
The text was updated successfully, but these errors were encountered: