turbo: [turborepo] Turborepo 1.7.0 hangs on Ctrl+C on Windows 11

What version of Turborepo are you using?

1.8.3, 1.7.0, works properly on 1.6.3

What package manager are you using / does the bug impact?

pnpm

What operating system are you using?

Windows 11

Describe the Bug

When I spin up my project using pnpm run dev (one Next.js package, one Payload CMS package, regardless of whether I run both of those or only either one of them using --filter) and try stopping the running command with Ctrl+C the terminal window hangs and I have to close it by clicking the close button or via Alt+F4.

It seems like it stops the running processes properly but Turbo hangs since the resources get freed properly (e.g. ports the apps are running on).

The next time I run pnpm run dev I get this:

WARNING  failed to contact turbod. Continuing in standalone mode: connection to turbo daemon process failed. Please ensure the following:
        - the process identified by the pid in the file at C:\Users\Bencun\AppData\Local\Temp\turbod\f9f4614d197fa42f\turbod.pid is not running, and remove C:\Users\<username>\AppData\Local\Temp\turbod\f9f4614d197fa42f\turbod.pid
        - check the logs at C:\Users\<username>\AppData\Local\turborepo\logs\f9f4614d197fa42f-cms-monorepo.log
        - the unix domain socket at C:\Users\<username>\AppData\Local\Temp\turbod\f9f4614d197fa42f\turbod.sock has been removed
        You can also run without the daemon process by passing --no-daemon

…everything runs fine but Ctrl+C causes Turbo to hang again.

The logfile in the provided path is empty.

If I delete the files at \AppData\Local\Temp\turbod the next start of dev command produces no error message but Ctrl+C hangs turbo again.

I’m on Windows 11 22H2 and I’m using Powershell. I’ve also tested this on macOS Ventura od 2019 Intel MBP 16" and there are no issues whatsoever on that platform.

Expected Behavior

Turbo exits gracefully.

To Reproduce

Run a pnpm + Turbo 1.7.0 monorepo locally on a Windows 11 machine. Run the kitchen-sink example with Turborepo 1.7.0 - so make sure to remove the pnpm lockfile first.

Reproduction Repo

Check above.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 23
  • Comments: 24 (4 by maintainers)

Commits related to this issue

Most upvoted comments

I have a fix for this. The problem is doubly stacked ctrl C handlers, which cancel eachother out. It should be available in the next release. Will post a PR link when it is ready 😃

Finally have a hypothesis! Has anybody happened to see a prompt that says Terminate batch job (Y/N)? when pressing ^C?

still happening with 1.8.3 (windows 11 10.0.22621 build 22621) if you ctrl+c then press y then enter twice the terminal seems to respond again attached a picture to demonstrate image

Yeah both issues happening in v.1.7.2. Can we start looking into turbo to fix it?