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

🐛 Bug Report: Container does not stop using SIGTERM - Podman/Docker resorts to SIGKILL #205

Open
msinfo32github opened this issue Aug 20, 2024 · 0 comments · May be fixed by #273
Open
Labels
bug Something isn't working

Comments

@msinfo32github
Copy link

Describe the bug

When using the Docker, or Podman container built either using this Dockerfile or the image at quay.io/redlib/redlib:latest, stopping the container using either podman stop redlib or docker stop redlib does not stop the container properly, and instead of using SIGTERM, the container stops using SIGKILL. This causes a 10 second delay in stopping the container.

Although not a large problem as Redlib does not store any data etc, this still delays container shutdown - e.g. added 10 second delay when shutting down a VM.

Steps to reproduce the bug

Pull container image from quay.io/redlib/redlib:latest or build from the Dockerfile

podman pull quay.io/redlib/redlib:latest

Run the container using Podman (same for Docker)

podman run --rm -d --name redlib -p 127.0.0.1:8080:8080 quay.io/redlib/redlib:latest

Stop the container

podman stop redlib

Warning from Podman (Docker does not give a warning, but there is still a 10s+ time stopping the container)

WARN[0010] StopSignal SIGTERM failed to stop container redlib in 10 seconds, resorting to SIGKILL 
redlib

What's the expected behavior?

Stopping the container using either podman stop redlib or docker stop redlib stopping quickly as it terminates PID 1 redlib properly with a SIGTERM to shut down the application instead of falling back on a SIGKILL.

Additional context / screenshot

This behaviour is seen using the Dockerfile in the root of this repository, the quay.io repository image as well as this Dockerfile seen at #122 (comment)

This could be worked around by either handling the SIGTERM in the redlib application itself, or by using a bash script to handle and pass a SIGKILL to the process received by the BASH script used as a container CMD - however this should not be the best setup as this could cause other problems by adding more complexity.

@msinfo32github msinfo32github added the bug Something isn't working label Aug 20, 2024
internationalcrisis added a commit to internationalcrisis/redlib that referenced this issue Oct 1, 2024
internationalcrisis added a commit to internationalcrisis/redlib that referenced this issue Oct 1, 2024
internationalcrisis added a commit to internationalcrisis/redlib that referenced this issue Oct 1, 2024
internationalcrisis added a commit to internationalcrisis/redlib that referenced this issue Oct 1, 2024
internationalcrisis added a commit to internationalcrisis/redlib that referenced this issue Oct 1, 2024
internationalcrisis added a commit to internationalcrisis/redlib that referenced this issue Oct 1, 2024
internationalcrisis added a commit to internationalcrisis/redlib that referenced this issue Oct 1, 2024
internationalcrisis added a commit to internationalcrisis/redlib that referenced this issue Oct 1, 2024
internationalcrisis added a commit to internationalcrisis/redlib that referenced this issue Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant