Skip to content

Commit 2e0ea48

Browse files
endolinbotclaude
andcommitted
common: guard the reset-path re-fetch in sync_clone so an offline blip still exits EX_TEMPFAIL under set -e
The reset-failure recovery path called journal_fetch as a bare statement (journal_fetch "$dir"; rc=$?). When the hard reset fails AND the re-fetch also fails (the classic connectivity outage), the bare call is itself a set -e exit: every set -e caller (claim-job, complete-job, all producers) died with the raw fetch rc before _fetch_stderr_is_offline could classify the blip and take the clean exit $GARDEN_OFFLINE_RC (75) tick-skip — re-introducing the exact per-blip FATAL the first fetch path was hardened against. Capture the rc through an if, the same guarded idiom as the first fetch. Repro (bare set -e caller; fetch#1 ok, reset fails, re-fetch offline): BEFORE exit rc=128 raw, no classification; AFTER exit 75 with "offline on reset; skipping tick". fetch-timeout-test.sh 12/12 and stale-lock-test.sh 7/7 pass. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 913cfc8 commit 2e0ea48

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

scripts/jobs/common.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2001,7 +2001,11 @@ sync_clone() {
20012001
# a connectivity outage, so exit EX_TEMPFAIL exactly like the fetch path. A
20022002
# reset that fails for any other reason still surfaces (the retry below dies).
20032003
if ! git -C "$dir" reset -q --hard "origin/$JOURNAL_BRANCH"; then
2004-
journal_fetch "$dir"; rc=$?
2004+
# Same guarded idiom as the first fetch above: a bare `journal_fetch ...; rc=$?`
2005+
# is a `set -e` exit at the call itself when the re-fetch ALSO fails (the classic
2006+
# connectivity outage), killing the process with the raw rc before the offline
2007+
# classification below can run.
2008+
if journal_fetch "$dir"; then rc=0; else rc=$?; fi
20052009
if [ "$rc" -ne 0 ] && _fetch_stderr_is_offline "$GARDEN_FETCH_STDERR"; then
20062010
log "offline on reset; skipping tick (rc=$GARDEN_OFFLINE_RC)"
20072011
exit "$GARDEN_OFFLINE_RC"

0 commit comments

Comments
 (0)