podman ps sometimes fails if container process is stopped and removed during call #11810
Labels
In Progress
This issue is actively being worked by the assignee, please do not work on this at this time.
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.
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
podman ps
can sometimes fail if a container is being removed during the method call.Steps to reproduce the issue:
In one terminal window run:
while true; do podman ps --format="{{.Names}} > /dev/null || echo "FAILED WITH CODE $?"; done
(This seems to more reliably occur when using the--format
argument and whilepodman ps -w 1
may be sufficient, the above seems more likely to run into this race condition)In a second terminal window start a bunch of arbitrary containers
for x in {1..30}; do podman run --rm -dt docker.io/alpine; done
(I think the--rm
flag is important to delete the container from the database thatpodman ps
is using to get the info about the container)Watch output in the first terminal while killing all the arbitrary containers in the second
podman kill --all
(For me, this shows the error most of the time, though occasionally we don't hit the race condition)Describe the results you received:
running the above steps gives me:
Describe the results you expected:
I expected that the
podman ps
command would output running processes. At worst case if a container is removed while podman ps is running, I would expect output to list the container even though it stopped, I wouldn't expect the entire command to error out.Additional information you deem important (e.g. issue happens only occasionally):
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/master/troubleshooting.md)
No
Additional environment details (AWS, VirtualBox, physical, etc.):
Reproduced on VirtualBox & Physical
The text was updated successfully, but these errors were encountered: