-
Notifications
You must be signed in to change notification settings - Fork 18k
proposal: cmd/go/internal/run: Use an exec without fork, or pass signals to child #54868
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
On the one hand, if you want fine-grained control over signal propagation you can always use On the other hand, it would be nice to preserve the PID presented to the parent when invoking |
Compare #40467. |
Half-related, but if the logic for |
I just ran into this issue, trying to send interrupts, sigterm, and sigkill to a child process that was being run via "go run" and no signals were being handled by my program which was unexpected. Also I would orphan my programs and it wasn't easy to understand why this was happening. I guess, the point of writing this comment is to give an Anecdote from the point of view of a regular, run of the mill, user. |
Recently, I also met this issue when developing vercel serverless function with golang runtime and vercel dev only kills the I think maybe it's better to patch on vercel side to bypass this situation. 🙈 |
go run ...
doesn't handle kill as one might expect. On at-least Linux, It will leave an orphaned process still running.There are a lot of cases where I think this would be useful, but using something like
kill $!
in a shell script would be oneOption 1: Use an exec (without fork) on the built binary so that the parent
go run ...
pid will be the same as the new built codeOption 2: Pass all signals to child. This wont work for some signals, but might be good enough.
The text was updated successfully, but these errors were encountered: