Skip to content

Clean interrupted Git repacks before sticky snapshots - #48

Merged
crohr merged 2 commits into
mainfrom
auto/cleanup-interrupted-git-repacks
Aug 3, 2026
Merged

Clean interrupted Git repacks before sticky snapshots#48
crohr merged 2 commits into
mainfrom
auto/cleanup-interrupted-git-repacks

Conversation

@crohr

@crohr crohr commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • persist the owned Git proxy PID and mirror root in GitHub action post-state
  • stop the proxy even if its mutable runtime state.json was deleted or corrupted
  • remove abandoned Git pack output after the proxy has fully stopped
  • constrain cleanup to temporary files beneath bare mirrors' objects/pack directories
  • rebuild the distributed Linux, ARM64, and Windows action binaries

Root cause

The Git proxy starts a background full repack after cloning a mirror. Its PID was available to the post-step only through $RUNNER_TEMP/runs-on/git-proxy/state.json; deleting or corrupting that file made cleanup silently leave the detached proxy running. A canceled or killed repack can then leave .tmp-<pid>-pack-* or tmp_pack_* output beside the original pack, and the runner can snapshot both copies.

Setup now records the PID and mirror root through GitHub's action post-state, independently of the mutable runtime file. The post-step uses that state to terminate the proxy, then removes unreferenced temporary pack files before the runner's clean unmount and snapshot.

This is stacked on #43 and targets its feature/sticky branch. It addresses the shutdown failure reported in #43's review thread at discussion_r3702181299.

Validation

  • go test ./...
  • go test -race ./internal/gitproxy ./internal/stickydisk
  • go vet . ./internal/gitproxy ./internal/stickydisk
  • upx -t main-linux-amd64 main-linux-arm64 main-windows-amd64.exe
  • rebuilt all distributed binaries with make dist

@crohr
crohr marked this pull request as ready for review August 3, 2026 08:16

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c3e244ed9b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/stickydisk/git.go Outdated
Base automatically changed from feature/sticky to main August 3, 2026 09:55
@crohr
crohr force-pushed the auto/cleanup-interrupted-git-repacks branch from 88a6140 to 394f95c Compare August 3, 2026 10:02
@crohr
crohr merged commit f7842ae into main Aug 3, 2026
9 checks passed
@crohr
crohr deleted the auto/cleanup-interrupted-git-repacks branch August 3, 2026 10:06
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