Skip to content

[ci] Retry dotnet-install script downloads with backoff - #13881

Open
simonrozsival wants to merge 1 commit into
mainfrom
simonrozsival-install-dotnet-retry
Open

simonrozsival wants to merge 1 commit into
mainfrom
simonrozsival-install-dotnet-retry

Conversation

@simonrozsival

Copy link
Copy Markdown
Member

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: 0b063316e7f1dc4fb2d77b39499190da1b388603

Dimension Assessment Rationale
Change confidence 9/10 ↑ Six isolated full-script scenarios cover retry count/backoff, failure status, caching and cleanup; Opus 5.5 review found no actionable issues.
↓ Live CDN download and CI execution were not validated.
Diagnosis confidence 9.5/10 ↑ The reported curl exit 52 aborts the existing single-attempt download under set -e before SDK installation.
Evidence fit 9/10 ↑ Isolated execution covers the observed transport error codes 35 and 52, plus 56.
↓ The underlying agent-specific network fault remains unverified and is not repaired by retries.

Context: #12120

SDK provisioning intermittently fails before installation with curl: (52) Empty reply from server. The installer-script download makes a single request, so transient CDN/network failures immediately fail the job.

Retry that download up to five times with 2/4/8/16-second backoff. Preserve the final curl exit code and atomic cache rename, and clean up partial downloads on exit. The loop handles transport failures without requiring --retry-all-errors, which older macOS curl versions lack. Arcade's retry helper is not sourced because its containing script initializes unrelated toolset and pipeline state.

Validation: bash -n eng/install-dotnet.sh and git diff --check origin/main...HEAD passed. An isolated python3 - harness executed the full script with mocked curl/sleep; all six scenarios passed: immediate success, transient exits 35/52/56, success on the final attempt, retry exhaustion with cleanup and exit-status preservation, cached installer, and installer failure propagation. An Opus 5.5 code-review subagent found no actionable issues.

No live CDN download, SDK installation, CI run or device tests were performed; validation was isolated to this provisioning-script change.

Context: #12120

A transient empty reply (curl exit 52) from the .NET CDN currently fails SDK provisioning immediately. Retry the installer-script download up to five times, with 2/4/8/16-second backoff, including transport errors unsupported by older curl retry flags.

Preserve the final curl exit code and atomic cache rename, and clean up partial downloads on exit. Keep retries local: sourcing Arcade tools initializes unrelated toolset and pipeline state.

Validation: bash -n eng/install-dotnet.sh and git diff --check passed. Isolated execution of the full script with mocked curl/sleep passed six scenarios: immediate success, transient exits 35/52/56, success on the final attempt, retry exhaustion and cleanup, cached installer, and installer failure propagation.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings December 2, 2026 10:42

Copilot AI 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.

🟢 Approval recommended

The installer-download retry change has no active review issues.

No open issues 🎉

What changed in this PR

Improves .NET SDK provisioning resilience by retrying installer-script downloads after transient network failures.

Changes:

  • Adds five download attempts with 2/4/8/16-second backoff, compatible with older curl versions.
  • Preserves the final curl exit code and atomic cache rename, and cleans up partial downloads on exit.
File Description
eng/​install-dotnet.sh Adds download retries, failure diagnostics, and temporary-file cleanup.

Review effort: Balanced

@PeppersMuse

Copy link
Copy Markdown

Reviewed the installer-download retry. What I checked:

  • Retry loop: 5 attempts with 2/4/8/16s backoff, retrying all curl failures as the comment says. The curl exit code is captured in download_exit_code in the failure branch and preserved via exit "$download_exit_code" after the final attempt, so the caller still sees the real failure (e.g. 35/52/56).
  • Cleanup: the trap 'rm -f "$install_script_tmp"' EXIT removes the partial download on every exit path, including the failure exit, and trap - EXIT clears it after the successful atomic mv to the cached path.
  • The if curl ...; then break; else ... guard means a failed download cannot abort the script early under set -e, and the success path still breaks out and renames exactly as before.
  • The mocked-harness validation in the description covers the six scenarios (immediate success, transient 35/52/56, success on the final attempt, exhaustion with cleanup and exit-code preservation, cached installer, installer failure propagation).
  • Copilot's review reported no open issues, and I found nothing to add.

This branch has not been deployed

No deployments
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.

3 participants