Skip to content

[release/10.0] Fix DownloadFile to only log errors when all retries are exhausted - #17821

Merged
mmitche merged 1 commit into
release/10.0from
miyanni-backport-16212-release-10-0
Nov 20, 2026
Merged

mmitche merged 1 commit into
release/10.0from
miyanni-backport-16212-release-10-0

Conversation

@MiYanni

@MiYanni MiYanni commented Nov 19, 2026

Copy link
Copy Markdown
Member

🤖Copilot🤖
Backport of #16212 to release/10.0.

Problem

DownloadFile.DownloadWithRetriesAsync calls Log.LogErrorFromException on every retry attempt. One transient network failure (for example, HttpRequestException: Error while copying content to a stream.) therefore fails the build even when the next retry succeeds. This still affects 10.0 consumers. For example, dotnet/sdk's release/10.0.1xx macOS leg failed in RestoreLayout.targets this way (dotnet/sdk#57209, build 1690453).

Change

Cherry-pick of 0da9aae. It moves Log.LogErrorFromException into the attempt > Retries failure path, so only the final failed attempt logs an error. Retries log informational messages only.

The cherry-pick conflicted because of the file-scoped namespace migration on release/10.0 (#17499), which changed indentation. I resolved it manually, and the final diff is the same one-line move as in #16212.

Relates to #16137

To double check:

Validation: .\eng\common\build.ps1 -restore -build -projects src\Microsoft.DotNet.Arcade.Sdk\Microsoft.DotNet.Arcade.Sdk.csproj passed (0 warnings, 0 errors). No tests were added, which matches the original change.

…ll retries are exhausted

Backport of #16212 to release/10.0.

(cherry picked from commit 0da9aae)

Co-authored-by: Copilot App <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 19, 2026 19:27

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

No active review issues are reported for the download-retry logging backport.

No open issues 🎉

What changed in this PR

Backports #16212 to release/10.0, preventing transient download failures from marking builds as failed when a later retry succeeds.

Changes:

  • Logs exceptions as errors only after all download retries are exhausted.
  • Keeps intermediate retry failures as informational messages.
File Description
src/​Microsoft.DotNet.Arcade.Sdk/​src/​DownloadFile.cs Moves exception error logging into the terminal failure branch.

Review effort: Balanced

@MiYanni
MiYanni marked this pull request as ready for review November 19, 2026 20:01
@MiYanni
MiYanni requested a review from mmitche November 19, 2026 20:02
@mmitche
mmitche merged commit 63b44dd into release/10.0 Nov 20, 2026
13 checks passed
@mmitche
mmitche deleted the miyanni-backport-16212-release-10-0 branch November 20, 2026 00:06
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.

4 participants