Skip to content

Branch change totals rerun a failing untracked-file listing on every status poll #34457

Closed

Description

@yaacovcorcos

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. Open a project whose repository has a large untracked tree (more than 5,000 untracked files,
    for example other checkouts or build output that is not ignored).
  2. Leave its status shown, so the 30 s status poll runs.
  3. Watch the server traces for GitVcsDriver.review.listUntracked.

Expected behavior

After a failed listing the totals are unavailable, and the same folder is not listed again on every
poll: it is retried after a while, or at once when its untracked set visibly changes.

Actual behavior

readBranchChangeTotals runs git ls-files --others --exclude-standard -z -- <roots> on every
status refresh. ls-files fills the whole untracked directory listing before printing
(fill_directory before show_other_files in builtin/ls-files.c), so the 5,000-path cap applied
afterwards does not bound the work; the 16 MiB output limit or the 30 s timeout ends it. The failure
is swallowed (Effect.orElseSucceed(() => undefined) around the totals), the status refresh itself
succeeds, and the broadcaster's backoff never applies.

In one workspace the server traces showed 103 consecutive failed listings in an hour, each span
lasting 5–30 s (elapsed time), with "Git output exceeded 16777216 bytes" or "Git command timed out".

prepareUntrackedReviewIndex also turns every listing failure into null, which the totals report as
"Too many untracked files to count." even for a timeout or a Git error.

Related: #25558 (slow change totals with a lot of untracked data) and #32463 (bounds the bytes the
review index reads). This issue is about repeating the listing after it failed.

Impact

Minor bug or occasional failure

Version or commit

main at 7e565c5

Environment

Observed on macOS 26 (Apple Git 2.54); the code path is the same on every platform.

Logs or stack traces

GitCommandError: Git command failed in GitVcsDriver.review.listUntracked (…): Git output exceeded 16777216 bytes and was truncated.
GitCommandError: Git command failed in GitVcsDriver.review.listUntracked (…): Git command timed out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions