-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[turborepo] regression on handling SIGINT #3711
Comments
I am actually facing the same issue with version |
Tagging @jaredpalmer for visibility |
May be fixed by #4276, could you verify against v1.8.5? |
Hey @mehulkar, I might be wrong, but I would say the issue persist. I updated the reproduction repo to use |
Thanks for trying! cc @arlyon @chris-olszewski |
### Description I believe this fixes #3711 #4196 added graceful shutting down when calling `go-turbo`, this does the same but for when we need to invoke the correct Rust binary in `shim.rs`. I extracted the logic added in #4196 to a function that can be used throughout the codebase. ### Testing Instructions Currently only doing manual via the reproduction provided in #3711. Edit: I originally wanted to add integration test to cover these cases, this has proven to be a challenge. Will still look at trying to orchestrate a test for this, but considering how much traction the related issues have, I don't want to block on getting an integration test.
@chris-olszewski I just saw a new Could you please reopen the issue? |
Update: Same with |
@notaphplover, can you confirm the expected outcomes of sending a Also, if you need an exit code 0, could you change the trap command to |
Hi @chris-olszewski 😃.
On my machine Regarding which version introduced this (I think) unexpected behavior, I tried with
Yeah, I know, the thing is, that's not what I want. I want to exit with code zero if and only if the process is able to exit gracefully with no issues. For that reason I want to Hope all of this helps. I would prefer not to pass through the pain of setting the remote debugging session, but if you really need it I can go for it in a couple of days. Edit: I just realized the debugging session wouldn't be of any help 😅, but the ssh connection would allow you to connect to the gh runner and recreate the issue. Probably an overkill since docker seems a much simpler way to go |
No need to, I just wanted to make sure that the description in the repro was correct and my machine was doing something weird.
Thanks for confirming, this narrows the code changes to check quite a lot.
Understand, just wanted to check if that would provide any intermediate relief. Sorry again for the drop in communication. |
All good. This is an open source project after all. Love the beautiful work you're doing. Sometimes these issues happen, I simply opened the other issue to avoid losing the tracking. |
@notaphplover I had some time to delve into this and this is a larger feature request. We currently always exit with exit code 1 if we receive a signal. In order to return the highest exit code we need to start gracefully handling signals where the first I don't expect this work will get done until we finish porting the codebase to Rust. Hopefully as we port this signal code we can set the groundwork for being more graceful with our signal handling. |
Is this working or will be fixed anytime soon? I'm having some issues that docker doesn't close when I do |
Experiencing the same issue, |
I found something that might be useful for addressing this issue: |
We are observing same issue :( |
Seeing same issue where docker fails to teardown when using turbo |
Same here in turbo |
Still broken in 2.3.3. The build system for monorepos is unable to close processes, which is quite strange. |
Is there any update on this? Also this was a very helpful comment:
But I really want to be able to run |
Not a great first impression using turborepo only to find out that we... can't trap exit codes... since February 2023? lol |
@anthonyshew Given that you removed the "ownedby" label a couple of months ago on this, is it possible you could provide some insight if the team that works on Turbo has any intention to fix this? |
Hey, @Scalahansolo, I was only removing one of our workstream automations. We don't need to mark Issues as owned by a specific team anymore since Turbopack is no longer in this repository. We're still working through fixes and features as usual. If you want to express your interest for this Issue, you can help us prioritize by adding your 👍 to the top-level if you haven't yet. Thanks! |
Is adding 👍🏼 to the top level issue how Turbo / Vercel decide to do prioritization? If so, that's good to know and everyone here should jump on board |
@Scalahansolo, it's one of a handful signals we use, yes. We have this GitHub Action and periodically check most-upvoted issues all-time as well (among many other signals). |
@anthonyshew Thanks for the info, gave it a thumbs up! That's a pretty nifty setup with that action. |
For those using |
I am closing this issue in favor of #9694 as this was left open for the specific ask of #9694. If you are encountering issues with signal handling, please give that issue a 👍 and include the following information which will help us understand what is happening:
|
What version of Turborepo are you using?
1.7.4
What package manager are you using / does the bug impact?
npm
What operating system are you using?
Linux
Describe the Bug
Referring to #444 and its implementation on #663, it looks like there was a behavioural regression introduced in
1.7.0
where SIGINT is no longer handled properly. The last working version was1.6.3
.The bug is related to the fact that when interrupting a program (
^C
), turbo doesn't wait for the program to handle the SIGINT command and immediately terminates the process.It is worth noting that the SIGINT instruction continues to run in the background, and the terminal becomes interactive again. This poses a problem when running turbo from a Docker container, for example, while Docker waits for the SIGINT instruction to be handled and then kills the container process. Since turbo doesn't wait for SIGINT to complete, docker simply kills the process prematurely. The expected behaviour here would be that of
1.6.3
.Expected Behavior
Turbo should wait for the program to handle the
SIGINT
instruction and only then exit the running process.To Reproduce
./apps/bar/package.json
[email protected] (expected behaviour)
[email protected] (unexpected behaviour)
Reproduction Repo
No response
The text was updated successfully, but these errors were encountered: