8000 fix(gitstore): repack through system git, not go-git's crashing RepackObjects by kvaps · Pull Request #251 · aenix-io/aeman · GitHub
[go: up one dir, main page]

Skip to content

fix(gitstore): repack through system git, not go-git's crashing RepackObjects - #251

Merged
kvaps merged 1 commit into
mainfrom
fix/repack-via-system-git
Sep 22, 2026
Merged

kvaps merged 1 commit into
mainfrom
fix/repack-via-system-git

Conversation

@kvaps
@kvaps kvaps commented Sep 22, 2026
Copy link
Copy Markdown
Member

Follow-up to #244. That change made maintenance repack the store at startup and hourly, which exposed a latent go-git bug: RepackObjects overflows 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.

…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>
@kvaps
kvaps merged commit e4dbfe4 into main Sep 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0