Repository navigation
Turn off git auto-maintenance in the archive - #1
Merged
Merged
Conversation
git runs `git maintenance run --auto --detach` after every commit. Once the loose-object count passes gc.auto, each commit starts its own detached full repack, and nothing stops a second one from starting while the first is still running. An archive's pack is mostly zstd or git-crypt blobs, so each repack holds gigabytes. One ingest tick makes one commit per changed session, which stacked repacks until a 16 GB Mac with a 7.3 GiB archive ran out of memory and had to be force-restarted. Set maintenance.auto=false and gc.auto=0 in the archive's local git config. init.py sets them after `git init`. ingest.py sets them under the ingest lock before the first commit, which migrates existing archives on their next tick. Loose objects now wait for a manual `git repack -d`. The selftest checks both the init path and the migration path.
This was referenced Sep 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
Sets
maintenance.auto=falseandgc.auto=0in the archive's local git config, so a holotype commit never starts a background repack.init.pysets them for new archives.ingest.pysets them for existing archives on their next tick.Why
git runs
git maintenance run --auto --detachafter every commit. When the loose-object count passesgc.auto, that starts a detached full repack (git repack --cruftandgit pack-objects --all). A second commit starts a second repack even while the first is still running. Ingest makes one commit per changed session, so a busy tick starts several at once.An archive's pack is mostly zstd or git-crypt blobs, which do not compress or delta. Each repack reads the whole pack and holds gigabytes. On a real archive (7.3 GiB pack, 16 GB Mac):
gitprocesses holding about 44 GB, alive for more than 12 hours.Reproduced on git 2.54 with a scratch repository: four commits in a row left five concurrent
pack-objects --allprocesses. With the two settings in place, the same commits started none.Turning auto-maintenance off is safer than tuning it. Tuning would still let repacks overlap, and repacking incompressible blobs gains nothing. Loose objects now wait for a manual
git repack -d, which packs only the loose objects and leaves the existing large pack alone.Type of change
Non-negotiables check
The change touches only
.git/configin the archive. No tracked content changes.Selftest
python scripts/selftest.pypasses locallyTwo new steps:
init.pysets both keys, andingest.pyrestores them on an archive where they were unset.Manifest / archive-format impact
manifest_versionbumped from N to N+1index_schema_versionbumped from N to N+1Documentation
CHANGELOG.mdupdated (under the next-release section, 2.4.1)README.mdupdated if user-facing behavior changedSKILL.mdupdated if wizard flow changeddocs/updated as appropriateCross-platform impact
AI assistance
Diagnosis, fix, and draft written by Claude Code from the macOS memory-kill reports and a scratch-repository reproduction. Selftest run locally.
Anything else reviewers should know
Out of scope:
run_gitiningest.pystill has no timeout, so a hunggit pushcan block a tick. That did not cause this incident.