Repository navigation
fix(gitstore): repack through system git, not go-git's crashing RepackObjects - #251
Merged
Merged
Conversation
…kObjects go-git's RepackObjects overflows the stack on a real board history and takes the whole process down, so the store never packed and pushes eventually could not be built inside their deadline, stranding committed work in the clone. Maintenance now shells out to the system git (git repack -ad) on the clone's on-disk path and rebuilds the storer's pack index so the running process still reads what git rewrote; the runtime image carries git for this. Commits are still built through go-git plumbing. Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
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.
Follow-up to #244. That change made maintenance repack the store at startup and hourly, which exposed a latent go-git bug:
RepackObjectsoverflows the stack on a real board history and crashes the whole process, so the previously rare 24h tick had only been hiding it. On production the process entered a restart loop.go-git cannot pack this store, but the clone is a plain on-disk git repository, so maintenance now shells out to the system
git(git repack -ad) and rebuilds the storer's cached pack index, so the running process keeps reading what git rewrote and deleted instead of seeing those objects vanish until a restart. The runtime image switches from distroless to a small alpine carrying git, ca-certificates and tzdata. Commits are still built through go-git plumbing; only the repack uses the binary.Verified: the existing repack tests now exercise the system git path (consolidation, history still readable, a second repack that deletes the first one's pack), and the built image's git repacks a copy of the production store as the non-root user.