Closed aojea closed 3 years ago
Thanks for reaching out. I can reproduce on master:
podman (master) $ sudo ./bin/podman save alpine | sudo ./bin/podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
Copying blob ace0eda3e3be [>-------------------------------------] 163.0KiB / 5.6MiB
It works with podman load
on the right side though
I can also reproduce as rootless
Okay, I think this cannot work. podman save alpine |
expects the pipe to be read but podman ps
does not do that. Hence's we're stuck on Copying blob ...
.
I think it's actually a livelock since save
opened a stream for copying the layer but the stream isn't consumed. Only once the layer has been copied, the storage lock will be released.
@rhatdan @giuseppe PTAL to have a second pair of eyes.
isn't it equivalent to $ podman save alpine | sleep infinity
? I am not sure we can do much about it
I concur. I am closing the issue but we can continue the conversation.
@aojea , where should the saved image go to?
Since we have a workaround and we really can not fix, I agree this shouldbe closed.
@vrothberg the image is piped into the containerd storage, using ctr --import -
@aojea, does that work?
I didn´t tried to do it directly, this is used by KIND to preload images on the cluster https://github.com/kubernetes-sigs/kind/pull/2041#issuecomment-768993462
So, basically it saves the output in the pipe, and in the other side of the pipe, it iterates through all the containers and copies the stream from stdin into ctr --import
Yes, that won't work. The data must be read immediately as it's holding the storage lock.
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
podman deadlocks when used in both sides of a pipe
Steps to reproduce the issue:
ok, this is interesting, there is a deadlock somewhere with podman, it hangs if I do
but it also doesn´t allow me to execute new podman commands :thinking: it is possible that
podman
doesn´t allow concurrent calls or if this calls involves storage? @mrunalp @mheonthis is the strace of the hanging command, it only happens if I use
sudo
by the wayDescribe the results you received:
commands hang, you can see that one side of the pipe is a
podman save
and in the other side it is usingpodman ps -a --filter ...
to find a container where to save the imageDescribe the results you expected:
podman should not deadlock, and allow to be used on the cli with pipes
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
):Installed from https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_18.04/ /
Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?
Yes
Additional environment details (AWS, VirtualBox, physical, etc.):
xref: https://github.com/kubernetes-sigs/kind/pull/2041