Repository navigation
[release/10.0] Fix DownloadFile to only log errors when all retries are exhausted - #17821
Merged
Merged
Conversation
…ll retries are exhausted Backport of #16212 to release/10.0. (cherry picked from commit 0da9aae) Co-authored-by: Copilot App <[email protected]>
Contributor
There was a problem hiding this comment.
🟢 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
marked this pull request as ready for review
November 19, 2026 20:01
mmitche
approved these changes
Nov 20, 2026
This was referenced Nov 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖Copilot🤖
Backport of #16212 to
release/10.0.Problem
DownloadFile.DownloadWithRetriesAsynccallsLog.LogErrorFromExceptionon 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'srelease/10.0.1xxmacOS leg failed inRestoreLayout.targetsthis way (dotnet/sdk#57209, build 1690453).Change
Cherry-pick of 0da9aae. It moves
Log.LogErrorFromExceptioninto theattempt > Retriesfailure 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.csprojpassed (0 warnings, 0 errors). No tests were added, which matches the original change.