-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[Bug] Unable to catch signals using Docker #1741
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
Comments
As a workaround you can use
|
Can you try master ( |
@arcanis hmm no unfortunately it still doesn't work using master ( |
I confused it with #991, which you mentioned in your post, sorry. I think we intended to forward the signals, but it slipped past our radar after the issue got closed. If you're interested to add this logic, I'd be happy to review that. It shouldn't be too hard, there are only two places where we spawn child processes: https://github.com/yarnpkg/berry/search?q=siginthandler&unscoped_q=siginthandler |
Was this ever fixed? I'm using |
Yes, see #2347 (comment) |
@merceyz so then, no, it wasn't fixed? That, or it's not planned to be fixed. |
Not sure how you interpreted my "Yes" to mean "no" but to be specific: |
@merceyz I interpreted it as "no" because you pointed me to a specific comment that doesn't say it's fixed, it calls out a workaround, and the comments afterwards state they're still having issues. /shrug |
It was this part of that comment that was of interest
Following that leads you to yarnpkg/yarn#8543 (comment) |
@merceyz ah, I see. I looked at the docker image from node, and yeah it uses |
@merceyz I have this issue with Yarn v4.0.0 + Yarn 1.22.19 edit: I'm using |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
To perform a graceful shutdown of containers we need a way to catch the signals (SIGTERM/SIGINT) that Docker sends when shutting down a container. In yarn v1 the workaround was to use
node <script>
directly instead ofyarn run
. However I can't seem to get this to work usingyarn node <script>
oryarn run
in v2 with PnP enabled.To Reproduce
Use a minimal Dockerfile:
Inside src/index.js, listen for signals
Then when the container kill it using:
Environment if relevant (please complete the following information):
Additional context
I also tried using
docker-init/tini
to play around the PID 1 restriction after reading #991 but that doesn't seem to work either. It would be nice if there is some way to forward signals to the child processes so that yarn v2 works nicely with Docker.The text was updated successfully, but these errors were encountered: