Skip to content

[Bug]: Checkpoint capture timeouts strand partial Git LFS temp files in .git/lfs/tmp (151 GB in about an hour) #41680

Done

Description

@abhirupghosh

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

Summary

A checkpoint capture that times out leaves partial Git LFS temp files in .git/lfs/tmp. Nothing removes them, and the next turn's capture hits the same timeout and leaves more. On one repo this reached about 150 GB in about an hour and filled the disk. Other repos and builds on that volume then failed with "no space left on device".

This looks like the case left over from #9776 (stale index.lock) and #3646 (tmp_pack litter after timeouts). Both are closed, but the LFS temp files still leak on the current nightly.

Steps to reproduce

  1. Use a repo whose .gitattributes routes *.zip and *.npz through Git LFS (filter=lfs).
  2. Put several GB of matching files in the working tree as untracked files. In our case that was a 3 GB folder of .npz files next to a tracked 2.9 GB .zip.
  3. Open a thread with that repo as its workspace and run a few turns.
  4. Watch .git/lfs/tmp.

Expected behavior

A capture that is cut off cleans up the files its Git processes wrote. A capture that can't finish stops being retried every turn.

Actual behavior

  • Each capture runs git add -A -- . with a scratch GIT_INDEX_FILE. Untracked files have no stat data in that index, so git-lfs's clean filter copies each matching file into .git/lfs/tmp while hashing it.
  • The baseline capture has a 5 s budget (BASELINE_CAPTURE_BUDGET), and other capture commands use the 30 s VcsProcess default. Hashing a few GB takes longer, so git add is killed partway through.
  • git-lfs does not remove its temp file when its parent git process dies, so every killed capture strands one or more files of up to a few GB.
  • Untracked blob reuse (CheckpointUntrackedBlobs) is only recorded after a successful capture. A capture that never finishes therefore re-hashes the same files on every turn.

What we saw on the machine:

  • Leftovers: 218 files in .git/lfs/tmp, about 151 GB in total, all created within roughly 70 minutes.
  • New file cadence: a new file appeared about every 30 s, some of them 0 bytes and some 1 to 2.5 GB.
  • The process behind each file was git-lfs filter-process, whose parent was git -C <repo> ... add -A -- . with GIT_INDEX_FILE=<git-common-dir>/t3-checkpoint-index-<uuid>, started by t3 serve.
  • After the cleanup: deleting the leftovers, removing the large untracked files and refreshing the real index stopped it. .git/lfs/tmp then stayed empty.

Impact

Major degradation or frequent failure

Version or commit

0.1.12-nightly.20261123.5151

Environment

Linux 6.8, git 2.43.0, git-lfs 3.4.1, ext4

Suggested fix

When a capture's git add fails, times out or is interrupted, remove the .git/lfs/tmp entries created during that capture once its process tree has exited. The repo-wide timeout backoff that already exists for baselines could also cover the per-turn capture, so a capture that can never finish stops being retried every turn.

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