turborepo: `SIGINT` being sent to `turbo` is not forwarded to underlying tasks

Expected behavior

kill -SIGINT ${TURBO_PID} should result in a SIGINT being sent to all tasks being run.

Actual behavior

SIGINT isn’t being sent.

Call To Action

If you are encountering an issue with signal handling please provide the following:

  • The output of turbo info
  • The command being used to invoke turbo
  • How the signal is being sent to turbo
  • A reproduction repository would be quite helpful as well

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 27
  • Comments: 20 (8 by maintainers)

Most upvoted comments

FYI, this issue is actually 2 years old and is still happening.

Sorry to sound negative but it didn’t quite make sense to me closing #3711, a 2 year old issue with 34 up votes and ask users to resubmit their cases? This feels more like a marketing driven decision to clear up old issues which are still unresolved? Even if I don’t really see that as a problem. I really appreciate the work you guys do but a bit more transparency as to why would be appreciated. 🙏

We see this issue when executing turbo through a yarn script at the root of our monorepo. Specially the issue that we see in our monorepo, is when the underlying dev task fails, the process isn’t always killed by turbo repo. Then, I’ll got to ctrl+c the entire turbo process but the underlying task isn’t killed. So when I go to run our dev command again the old dev task` is still sticking around and I need to hunt down the PID to manually kill it.

As an aside… given that Turbo prioritizes their work in part by the number of 👍🏼 on a given bug report, it’s a bummer that we’ve now lost that tracking by porting it to a new issue.

Hi @chris-olszewski , I’m experiencing this issue.

`turbo info` (click to expand)
turbo 2.5.0

CLI:
   Version: 2.5.0
   Path to executable: /opt/homebrew/lib/node_modules/turbo/node_modules/turbo-darwin-arm64/bin/turbo
   Daemon status: Not running
   Package manager: Not found

Platform:
   Architecture: aarch64
   Operating system: macos
   WSL: false
   Available memory (MB): 5025
   Available CPU cores: 12

Environment:
   CI: None
   Terminal (TERM): xterm-ghostty
   Terminal program (TERM_PROGRAM): ghostty
   Terminal program version (TERM_PROGRAM_VERSION): 1.1.3
   Shell (SHELL): /bin/zsh
   stdin: false

I’ve been exploring turborepo (it’s great!) and sst lately, maybe the setup can be improved.

A turbo dev task is being launched by an sst dev command when running sst dev. I need to run sst dev (in some way, in parallel to app servers like next dev) because sst provides resources the app depends on (e.g. database and s3 bucket info).

sst dev command (see `dev` key):
export const nextjs = new sst.aws.Nextjs("MyAppWeb", {
  path: "./../../apps/myapp",
  buildCommand: "pnpm exec open-next build",
  vpc,
  warm: 0,
  link: [relationalDatabase, sourceImagesBucket],
  environment: {
    DB_HOSTNAME: relationalDatabase.host,
    DB_PORT: relationalDatabase.port.apply((v) => String(v)),
    DB_USER: relationalDatabase.username,
    DB_PASSWORD: relationalDatabase.password,
    DB_DATABASE: relationalDatabase.database,
    ... (etc)
  },
  dev: {
    command: "turbo dev --filter=@workspace/myapp...",
    url: "http://localhost:3000/",
  },
});

turbo provides the dev mode experience when it comes to packages that this app depends on (e.g. I can run next dev but also bunchee --watch on compiled UI libs it depends on, etc), whereas sst gives the dev mode to run lambdas, Fargate and db resources locally.

I need to close or restart next dev or sst dev in general (ctrl-c in the sst multiplexer), but next dev (the dev task in @workspace/myapp) keeps running when stopping the sst dev multiplexer, so running sst dev again starts a new next server. It’s only this turbo command that seems to not close.

It happens with both ui as tui and streamer.

i have this issue when i run turbo under an sst dev command. when i quit, sst tries to clean up and shows success but it does leave quite a few processes running in the background.

I run into this problem often when using TUI but when not using TUI I think perhaps I have never run into it.

@erhan-talarian I am splitting out your report into a new issue since Windows doesn’t have signals you can send to processes but instead console level handlers. Any fixes around unix style signal handling would likely not solve any Windows issues and vice versa.

The daemon can take up significant CPU when hashing repository contents in the background, https://github.com/vercel/turborepo/pull/9572 and https://github.com/vercel/turborepo/pull/9564 should keep resource usage in check.