Skip to content
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

Slow git status causes Turbo to hang #8667

Open
1 task done
samhh opened this issue Jul 4, 2024 · 3 comments
Open
1 task done

Slow git status causes Turbo to hang #8667

samhh opened this issue Jul 4, 2024 · 3 comments
Labels
kind: bug Something isn't working needs: triage New issues get this label. Remove it after triage

Comments

@samhh
Copy link

samhh commented Jul 4, 2024

Verify canary release

  • I verified that the issue exists in the latest Turborepo canary release.

Link to code that reproduces this issue

n/a

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

Yarn v2/v3/v4 (node_modules linker only)

What operating system are you using?

Mac

Which canary version will you have in your reproduction?

2.0.6

Describe the Bug

I use Git-backed Jujutsu, so in my repo I very rarely run git status. Not doing so for a while can be laggy for reasons that are probably obvious to anyone familiar with Git's innards.

This causes Turbo caching to radically slowdown, so the extent that a task that usually completes and caches in a few seconds will hang up the system with 100% CPU. Notably this task outputs lots of small files to disk.

$ turbo run my-task &
$ turbo daemon -vvv
[...]
2024-07-04T16:19:15.650+0100 [DEBUG] turborepo_scm::package_deps: failed to use git to hash files: git error: 'git status' in /path/to/workspace exited with code unknown. Falling back to manual
<C-c>
$ git status
$ turbo run my-task # works

Expected Behavior

The task completes like usual, possibly with an additional slowdown comparable to running git status once first, which fixes the issue.

To Reproduce

Presumably it'd be possible to repro and fix if you can find a way to artificially slow Git down.

Additional context

This is a bit of an edge case given Git's ubiquity, so I wouldn't mind if you closed this as not fixing. I figured I'd at least report it for anyone else using Jujutsu and hitting this issue.

Related: #8122

@samhh samhh added kind: bug Something isn't working needs: triage New issues get this label. Remove it after triage owned-by: turborepo labels Jul 4, 2024
@NicholasLYang
Copy link
Contributor

Perhaps I'm not sufficiently familiar with git's innards, but why does not running git status for a while make it laggy? Does Jujutsu not use the fsmonitor daemon? And is that SCM log coming from the daemon or the turbo run process? If it's the former, could you try running with --no-daemon?

@samhh
Copy link
Author

samhh commented Jul 9, 2024

I believe there is fsmonitor support in Jujutsu via Watchman, which I currently have disabled. Presumably since git fsmonitor--daemon internally touches the same Git paths as git status the idea is it should sort of implicitly solve the lagginess for me?

The SCM log came from the Turbo daemon. Next time the lag builds up I'll try to remember to give --no-daemon a go.

@NullVoxPopuli
Copy link

git can also be slow on corporate machines with a number of security tools intercepting every disk i/o behavior

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Something isn't working needs: triage New issues get this label. Remove it after triage
Projects
None yet
Development

No branches or pull requests

4 participants