Skip to content

download.sh: retry transient MIT fetch failures (fail fast on expected 404) - #24

Merged
mikeparkflex merged 1 commit into
mainfrom
mike/download-sh-retry-logic
Jun 9, 2026
Merged

download.sh: retry transient MIT fetch failures (fail fast on expected 404)#24
mikeparkflex merged 1 commit into
mainfrom
mike/download-sh-retry-logic

Conversation

@mikeparkflex

@mikeparkflex mikeparkflex commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

The ESP 1.29.2 release build failed at Run download.sh: both curl --head probes to acdl.mit.edu timed out (~134s each), so the script hit its not-found branch and exited 1. MIT was actually up — it was a transient runner→MIT connectivity blip (a re-run succeeded immediately).

Change

Route both the location probe and the download through a mit_curl() helper:

  • --retry 5 --retry-delay 5 --retry-connrefused — ride out transient errors (timeouts, 5xx, refused connections).
  • --connect-timeout 30 — a hung endpoint fails in 30s instead of stalling for minutes.
  • A 404 is not retried (curl's --retry skips it), by design: a given ESP version lives in exactly one of PreBuilts/ or archive/ (MIT moves releases to archive/ as they age out), so a 404 from the other directory is expected and should fail over immediately rather than burn retries.
  • Dropped the redundant -O … -o (which logged Got more output options than URLs).

Test plan

  • bash -n download.sh clean
  • ./download.sh 129 end-to-end: probe → download → all three 129 patches applied, exit 0
  • ✅ Expected 404 (archive/ESP129…) fails fast, no retry (~0s, exit 22)
  • ✅ 200 probe (PreBuilts/ESP129…) succeeds immediately

Context: surfaced while cutting ESP 1.29.2 (the release carrying the FXC-8846 OuterShell fix, #23).

🤖 Generated with Claude Code


Note

Low Risk
Build-script-only change to download reliability; no auth, data, or application runtime paths affected.

Overview
Hardens MIT ESP tarball fetching in download.sh so CI no longer fails on transient acdl.mit.edu timeouts while still failing over quickly when a version is only in archive/ (expected 404).

A new mit_curl() helper wraps probe and download curl calls with --connect-timeout 30, --retry 5, and related flags for timeouts/5xx/refused connections; 404s are not retried, so PreBuilts vs archive probing stays immediate. The script picks the winning URL from HEAD checks, downloads once with -o, and drops the invalid -O … -o combination. Comments and log/error text clarify one-location-per-version semantics and “unreachable after retries” vs hard not-found.

Reviewed by Cursor Bugbot for commit 37d4633. Bugbot is set up for automated code reviews on this repo. Configure here.

…d 404

The ESP 1.29.2 release build failed when both `curl --head` probes to
acdl.mit.edu timed out (~134s each) and download.sh fell through to its
not-found branch. MIT was reachable -- it was a transient runner->MIT blip.

Route the probe and download through mit_curl(): --retry / --retry-connrefused
ride out transient errors (timeouts, 5xx, refused connections) and
--connect-timeout 30 keeps a hung endpoint from stalling the job for minutes.
A 404 is deliberately NOT retried (curl --retry skips it) -- a given version
lives in exactly one of PreBuilts/ or archive/, so a miss in the other is
expected and should fail over immediately. Also drops the redundant
`-O ... -o` (which logged "Got more output options than URLs").

Verified: ./download.sh 129 completes end-to-end (probe -> download -> all
three 129 patches, exit 0); the expected 404 on archive/ fails fast (~0s).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mikeparkflex
mikeparkflex merged commit 8264965 into main Jun 9, 2026
2 checks passed
@mikeparkflex
mikeparkflex deleted the mike/download-sh-retry-logic branch June 9, 2026 14:14
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