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

podman restart with port bindings results in 'port in use' errors #240

Closed
baude opened this issue Feb 23, 2021 · 2 comments · Fixed by #241
Closed

podman restart with port bindings results in 'port in use' errors #240

baude opened this issue Feb 23, 2021 · 2 comments · Fixed by #241
Assignees

Comments

@baude
Copy link
Member

baude commented Feb 23, 2021

Sometimes when restarting a container with podman restart, it results in a port already in use error. It seems like you need to have an application in the container that takes a little longer to execute to trip it more reliably.

Reproducer

$ sudo podman run -dt --name foo -p 80:80 alpine_nginx
b7fc4ef1bc8a130ec0dec234c59bc11a7d6e88b24e48d04e8afede3b832db3db
$ sudo podman restart foo
Error: cannot listen on the TCP port: listen tcp4 :80: bind: address already in use

split from containers/podman#9465

@rhatdan
Copy link
Member

rhatdan commented Feb 23, 2021

Should restart also imbed a podman wait. Probably does podman stop; podman start. Should do
podman stop; podman wait; podman start. Since podman container cleanup has to happen after the stop completes, and this is where the race probably is.
Have not looked at the code, but that's my guess.

@mheon
Copy link
Member

mheon commented Feb 23, 2021

It calls cleanup itself, automatically - we actually SIGKILL conmon so the cleanup process never fires (for unrelated reasons - there was a race where conmon took too long to die and was holding ports we needed).

@baude baude self-assigned this Feb 23, 2021
@giuseppe giuseppe transferred this issue from containers/podman Feb 24, 2021
@giuseppe giuseppe self-assigned this Feb 24, 2021
giuseppe added a commit to giuseppe/conmon that referenced this issue Feb 24, 2021
commit 0f092d5 introduced the
regression.

Closes: containers#240

Signed-off-by: Giuseppe Scrivano <[email protected]>
giuseppe added a commit to giuseppe/conmon that referenced this issue Mar 1, 2021
commit 0f092d5 introduced the
regression.

Closes: containers#240

Signed-off-by: Giuseppe Scrivano <[email protected]>
haircommander pushed a commit that referenced this issue Mar 1, 2021
commit 0f092d5 introduced the
regression.

Closes: #240

Signed-off-by: Giuseppe Scrivano <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants