🤖 fix: detach SSH base repo gc#3346
Conversation
Run SSH base-repo gc as a remote detached maintenance process instead of holding it under mux's SSH command timeout. This keeps the advisory defragmentation path while avoiding SIGKILL during Git pack finalization. Tests update retry orchestration expectations for the detached gc spawn timeout. --- _Generated with `mux` • Model: `openai:gpt-5.5` • Thinking: `xhigh` • Cost: `$27.08`_ <!-- mux-attribution: model=openai:gpt-5.5 thinking=xhigh costs=27.08 -->
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2a45337372
ℹ️ 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".
Keep proactive base repo gc advisory, but use setsid -w for retry cleanup so retries can wait for detached maintenance without letting mux's timeout kill git gc itself. Also preserve missing-setsid diagnostics by checking command availability before redirecting gc output to the remote log.
|
Addressed Codex feedback:
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Summary
Detach shared SSH base-repo gc from mux's SSH command timeout so maintenance can keep long-lived bare repos defragmented without mux killing Git mid-pack-finalization.
Background
The existing base repo maintenance path ran
git gc --prune=nowthrough mux's timed SSH command wrapper. On large shared bare repos, that timeout can fire while Git is finalizing packs, leaving a.packwithout its matching.idx. Git then cannot see the objects in that pack, and later sync pushes can fail with unresolved remote deltas.Implementation
This keeps the existing maintenance triggers and retry flow, but runs gc through
setsidso the actual Git process is in its own session/process group. Proactive preflight usessetsid -fand only waits for the remote spawn because that maintenance is advisory. Retry cleanup usessetsid -f -w, which waits for the detached child to exit and returns its status, so the next retry can benefit from completed maintenance without putting gc itself under mux's kill timeout. Missingsetsidis checked before redirecting gc output, so local logs preserve actionable spawn diagnostics; gc's own output still goes to/tmp/.mux-base-repo-gc.logon the SSH host.Risks
The behavior depends on util-linux
setsidwith-f/-wsupport on the SSH host. If it is missing, maintenance logs a warning and sync proceeds through the existing best-effort path; correctness is preserved, but base-repo defragmentation may not run on that host.Generated with
mux• Model:openai:gpt-5.5• Thinking:xhigh• Cost:$29.50