-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
podman machine on Windows WSL2 does not stop "autoremove" containers depending on Windows machine #21482
Comments
Don't reproduce on my W11Pro machine. wsl --version
podman info
|
This is not really related to machine at all, you can just hard shut-down any system and the containers will persist as we only delete them on stop. I think the best thing would be for podman to check for autoremove containers in the system refresh logic and delete them there ( after the new boot) @mheon WDYT? |
Yeah, changing refresh logic to remove any container with autoremove set in the Exited state (otherwise we catch never-started containers) would resolve this. |
During system shutdown, Podman should go down gracefully, meaning that we have time to spawn cleanup processes which remove any containers set to autoremove. Unfortunately, this isn't always the case. If we get a SIGKILL because the system is going down immediately, we can't recover from this, and the autoremove containers are not removed. However, we can pick up any leftover autoremove containers when we refesh the DB state, which is the first thing Podman does after a reboot. By detecting any autoremove containers that have actually run (a container that was created but never run doesn't need to be removed) at that point and removing them, we keep the fresh boot clean, even if Podman was terminated abnormally. Fixes containers#21482 [NO NEW TESTS NEEDED] This requires a reboot to realistically test. Signed-off-by: Matt Heon <mheon@redhat.com>
Issue Description
We are encountering different behaviours of the same podman machine server (4.9.0) on two different Windows machines (both W11). We are using WSL2 to run the machines on both sides.
On the first machine, we have a container marked as "Autoremove" running, when we stop and restart the podman machine, the container has been deleted.
On the second machine, with the same container marked as "Autoremove", when the podman machine is stopped and restarted, the container is still present (and stopped) after the restart.
I'm not sure if is related to Windows version or not, but what is the expected behaviour? Deleted or not deleted?
Do you have an idea where the difference of behaviour could come from?
Steps to reproduce the issue
Steps to reproduce the issue
Describe the results you received
An empty list on first machine, a stopped container on second machine.
Describe the results you expected
An empty list on both versions
podman info output
Podman in a container
No
Privileged Or Rootless
Rootless
Upstream Latest Release
Yes
Additional environment details
First machine (container deleted):
Second machine (container not deleted):
Additional information
Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting
The text was updated successfully, but these errors were encountered: