Skip to content

Retry stalled SwiftPM artifact downloads - #59214

Closed
cortinico wants to merge 2 commits into
mainfrom
ci/retry-stalled-spm-artifact-downloads
Closed

cortinico wants to merge 2 commits into
mainfrom
ci/retry-stalled-spm-artifact-downloads

Conversation

@cortinico

@cortinico cortinico commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

SwiftPM artifact setup currently fails an entire CI lane when a Maven response stalls mid-body. This change:

  • aborts a download after 60 seconds without body progress;
  • retries transient transport errors and HTTP 408/429/5xx responses up to three total attempts with short backoff;
  • keeps deterministic HTTP client errors fail-fast; and
  • removes partial .download files before retrying, so a retry cannot reuse truncated content.

Changelog:

[INTERNAL] [FIXED] - Retry stalled SwiftPM artifact downloads

Diagnosis

main commit f1f516e8cb2f6c085bcc08838066b5b49c08da3b failed test_ios_spm_rntester / test (Debug) in job https://github.com/react/react-native/actions/runs/39353507614/job/118412160607. The Hermes release artifact stopped at 8.0 MB of 24.2 MB and 0 KB/s for about ten minutes before Node fetch reported terminated.

This is a transport flake rather than a deterministic source regression:

  • the Release sibling on the same SHA completed successfully;
  • both SwiftPM RNTester lanes passed on each of the 19 preceding main workflow runs (38/38 checks);
  • the tip commit only changes Fantom SelectableParagraph rendering; and
  • the exact failed artifact downloaded successfully on a subsequent probe (25,372,145 bytes in 0.29 seconds).

Because the failure is nondeterministic and independent of the commit contents, a code bisect cannot identify a meaningful introducing commit. Searches of open PRs and prior CI-monitor runs found no existing fix for this stalled-download signature. PR #59068 mentions the downloader only in its diagnosis and changes different prebuild files.

Test Plan

  • node --check packages/react-native/scripts/spm/download-spm-artifacts.js
  • npx -y prettier@3.9.4 --write packages/react-native/scripts/spm/download-spm-artifacts.js packages/react-native/scripts/spm/__tests__/download-spm-artifacts-test.js (no changes)
  • jest --runInBand packages/react-native/scripts/spm/__tests__/download-spm-artifacts-test.js — 76/76 tests passed, including transient stream retry, idle-body retry, partial-file cleanup, and fail-fast HTTP 404 coverage
  • Live curl probe of the exact Hermes artifact — HTTP 200, 25,372,145 bytes

Risk and limitations

A genuinely slow transfer that makes no progress for 60 seconds is restarted, which may add up to roughly two minutes plus backoff before the final failure. The retry is bounded and final errors are still surfaced; deterministic 4xx responses are not retried. Full RNTester/Xcode CI was not reproduced locally because the failure is in remote transport rather than compilation.

@cortinico
cortinico requested a review from cipolleschi October 20, 2026 04:03
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 20, 2026
@meta-codesync

meta-codesync Bot commented Oct 20, 2026

Copy link
Copy Markdown

@cortinico has imported this pull request. If you are a Meta employee, you can view this in D126318143.

@meta-codesync meta-codesync Bot closed this in fcd141c Oct 20, 2026
@react-native-bot

Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @cortinico in fcd141c

When will my fix make it into a release? | How to file a pick request?

@react-native-bot react-native-bot added the Merged This PR has been merged. label Oct 20, 2026
@meta-codesync

meta-codesync Bot commented Oct 20, 2026

Copy link
Copy Markdown

@cortinico merged this pull request in fcd141c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants