When DOLT_FETCH fails (network error, timeout, authentication), Dolt
leaves orphaned tmp_pack_* files in .dolt/git-remote-cache/. These
accumulate unboundedly across repeated failures and are never cleaned
up automatically.
Observed impact: 194 GB of tmp_pack_* debris on a single machine after
months of failed federation syncs.
Call DoltGC best-effort after a failed fetch so orphaned pack
temporaries are reclaimed before the error propagates. DoltGC requires
a non-transactional connection; if db is a transaction the GC will
fail silently, which is acceptable — the original fetch error is still
returned correctly.
Cherry-picked from #3308 by @athosmartins. The original PR bundled an
unrelated Gas Town schema migration (re-adding the `crystallizes`
column that migration 012 explicitly dropped) and accidentally deleted
a working #nosec directive in rules.go, so this pulls out just the
valuable fix.
Closes bd-fst
Co-authored-by: Athos Bernardes <athosmartins@gmail.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>