Skip to content

fix(ci): Retry binary downloads on transient HTTP errors#2509

Merged
charlesvien merged 3 commits into
mainfrom
06-06-retry_binary_downloads_on_transient_http_errors
Jun 9, 2026
Merged

fix(ci): Retry binary downloads on transient HTTP errors#2509
charlesvien merged 3 commits into
mainfrom
06-06-retry_binary_downloads_on_transient_http_errors

Conversation

@charlesvien

@charlesvien charlesvien commented Jun 6, 2026

Copy link
Copy Markdown
Member

Problem

Release publish fails when GitHub's release CDN returns a transient HTTP 504 while postinstall downloads the codex-acp binary, since the download has no retry and one blip aborts the whole install.

Changes

  1. Add bounded exponential-backoff retry to binary downloads (5 attempts)
  2. Retry transient failures: 5xx, 429, 408/425, and network-level errors
  3. Fail fast on non-retriable statuses like 404 so missing assets don't waste retries
  4. Cap backoff delay (1s to 8s, ~15s max added latency)

How did you test this?

I did not

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

@charlesvien charlesvien changed the title Retry binary downloads on transient HTTP errors fix(ci): Retry binary downloads on transient HTTP errors Jun 6, 2026

charlesvien commented Jun 6, 2026

Copy link
Copy Markdown
Member Author

@charlesvien charlesvien marked this pull request as ready for review June 6, 2026 20:27
@greptile-apps

greptile-apps Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

T-Rex T-Rex Logs

What T-Rex did

  • Generated targeted retry tests for downloadFile in apps/code/scripts/download-binaries.mjs.
  • Verified retriable HTTP statuses 408, 425, 429, 500, 502, 503, and 504 retry before either succeeding or exhausting attempts.
  • Verified non-retriable statuses such as 401, 403, and 404 fail immediately.
  • Verified network errors and stream errors retry, including a partial-write case where the next successful write replaces the failed archive content.
  • Verified the backoff sequence is 1000ms, 2000ms, 4000ms, and 8000ms across the retry attempts.
  • Confirmed pipeline(WebReadableStream, createWriteStream) works in the runtime compatibility check.
Artifacts

Generated retry test harness

  • This harness enables running and inspecting the retry scenarios for downloadFile.

Generated retry test output

  • A log of the retry test run showing outcomes and timings for each scenario.

T-Rex Ran code and verified through T-Rex

Reviews (1): Last reviewed commit: "Retry binary downloads on transient HTTP..." | Re-trigger Greptile

@k11kirky k11kirky left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@charlesvien charlesvien force-pushed the 06-06-retry_binary_downloads_on_transient_http_errors branch from eda4c7c to 89dfb6d Compare June 9, 2026 01:37
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 89dfb6d.

@charlesvien charlesvien enabled auto-merge (squash) June 9, 2026 01:42
@charlesvien charlesvien merged commit 1123df1 into main Jun 9, 2026
20 checks passed
@charlesvien charlesvien deleted the 06-06-retry_binary_downloads_on_transient_http_errors branch June 9, 2026 01:45
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.

2 participants