Skip to content

[Bug]: Continuous full-untracked Git polling consumes CPU in large monorepos on v1.4.130 #7983

Closed

Description

@andrewli81

Operating system

macOS

Orca version

1.4.130

Details

Short summary

On a large monorepo, Orca continuously runs:

git -c core.quotePath=false status --porcelain=v2 --branch --untracked-files=all

Each scan takes about 35–45 seconds and the next scan starts only a few seconds later. This keeps a Git process consuming CPU almost continuously while the workspace is idle.

This still reproduces on v1.4.130 after a clean restart with one Orca main process and a newly launched daemon. It is not a build and is independent of the Keep local main up to date setting, which was disabled.

Environment

  • macOS 26.5.1
  • Orca 1.4.130
  • Apple Git 2.50.1
  • Large monorepo with multiple worktrees
  • No Bazel, compiler, or other build running
  • Clean restart: the pre-update Orca daemon and its terminal sessions were terminated before testing

Reproduction

  1. Add a large monorepo where a full git status --untracked-files=all takes tens of seconds.
  2. Open a workspace for that repository.
  3. Leave the workspace idle for at least two minutes.
  4. Inspect Orca child processes or ~/Library/Application Support/orca/logs/main.trace.ndjson.

Observed

In a clean single-instance two-minute sample:

status --porcelain=v2 --branch --untracked-files=all   35.487s
diff                                                     5.661s
status --porcelain=v2 --branch --untracked-files=all   35.117s

The second status scan started about 8.7 seconds after the first completed. A live process snapshot showed the status child consuming 48–68% CPU for tens of seconds.

A longer trace from the same repository contains hundreds of these scans, averaging roughly 53 seconds, so the polling becomes effectively continuous.

Expected

Background source-control refresh should not continuously rescan every untracked path when a status operation takes longer than the polling interval. Possible mitigations include:

  • coalescing and backing off based on the previous scan duration;
  • invalidating status from filesystem events instead of fixed polling;
  • avoiding --untracked-files=all for background checks;
  • offering a per-repository large-repo mode or polling opt-out.

Related work

#6381 and #6413 reduced refresh fanout and upstream/push-target polling. The remaining issue here is the regular status poll: on a large repository it is not cheap and never reaches an idle state.

I can provide additional sanitized trace excerpts if useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    os:macos

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions