Skip to content

fix(jobs): disable default timeout for mirror sync git commands#904

Open
syf2211 wants to merge 1 commit into
charmbracelet:mainfrom
syf2211:fix/803-mirror-sync-timeout
Open

fix(jobs): disable default timeout for mirror sync git commands#904
syf2211 wants to merge 1 commit into
charmbracelet:mainfrom
syf2211:fix/803-mirror-sync-timeout

Conversation

@syf2211

@syf2211 syf2211 commented Jun 25, 2026

Copy link
Copy Markdown

Summary

Mirror sync jobs now disable git-module's 1-minute default timeout for fetch --prune and remote update --prune, preventing large mirror repos from being left in a broken partially-synced state.

Motivation

mirror-pull builds git commands without an explicit timeout, so git-module applies DefaultTimeout (1 minute). For large repos, the fetch can be killed mid-transfer after --prune has already removed local refs that no longer exist on the remote, but before new refs are fully fetched.

ImportRepository already uses Timeout: -1 for the initial mirror clone; the periodic sync path did not.

Fixes #803

Changes

  • Add .WithTimeout(-1) to mirror sync git commands in pkg/jobs/mirror.go
  • Matches the existing pattern used in git/server.go and pkg/lfs/scanner.go

Tests

  • go test ./pkg/jobs/... ./git/... — pass

Notes

No new unit test added; timeout behavior is inherited from git-module and would be slow/flaky to exercise in CI. The change is a one-line call-site fix consistent with other long-running git operations in this repo.

Mirror fetch/update commands inherit git-module's 1-minute DefaultTimeout
when no explicit timeout is set, which can kill large repo syncs mid-transfer
after prune has already removed local refs.

Apply WithTimeout(-1) to both sync commands, matching ImportRepository's
clone behavior and other long-running git paths in the codebase.

Fixes charmbracelet#803
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.

fix(jobs): mirror sync killed by 1-minute default timeout, leaving repos in broken state

2 participants