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

uv run doesn't pass signals to children #6724

Closed
overfl0 opened this issue Aug 27, 2024 · 5 comments · Fixed by #8933
Closed

uv run doesn't pass signals to children #6724

overfl0 opened this issue Aug 27, 2024 · 5 comments · Fixed by #8933
Labels
bug Something isn't working

Comments

@overfl0
Copy link

overfl0 commented Aug 27, 2024

When you pass uv run as the command in compose.yml, you can't gracefully stop the process by pressing Ctrl+C. I'm guessing it's because it's not passing sigterm to its children.

Steps to reproduce:

You will have to wait 10 seconds until docker forcibly sigkills the process.

Then:

  • remove uv run from the command: command: fastapi dev --host 0.0.0.0 src/uv_docker_example
  • docker compose up
  • Press Ctrl+C

Compose will shutdown the process almost instantaneously.

uv 0.3.3 (according to uv-docker-example's Dockerfile)

@zanieb
Copy link
Member

zanieb commented Aug 27, 2024

Thanks for the report!

@zanieb zanieb added the bug Something isn't working label Aug 27, 2024
@charliermarsh
Copy link
Member

Interesting... We do pass Ctrl+C, so I would expect this to work.

@overfl0
Copy link
Author

overfl0 commented Aug 28, 2024

According to https://hynek.me/articles/docker-signals/ the signal that docker is supposed to send you is SIGTERM (so not SIGINT, which is sent on Ctrl+C), but I'm not an expert on this so all i can do is link you to that page

@overfl0
Copy link
Author

overfl0 commented Aug 28, 2024

Although I have to add that both adding STOPSIGNAL SIGINT to the Dockerfile and stop_signal: SIGINT to compose.yml failed for me, for some reason, as well.

@shaneikennedy
Copy link
Contributor

Would it be possible to get a new patch release with this issue now close, please? Not properly handling SIGTERM is negatively impacting anyone running uv in production with containers. For those who know it's a problem in their workloads they could mitigate this by running uv with something like tini but would prefer to get a new version here if possible 🙏

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.

4 participants