-
Notifications
You must be signed in to change notification settings - Fork 228
Fix DownloadWithRetries to actually retry on network errors #3858
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…rrors Co-authored-by: mmitche <[email protected]>
Co-authored-by: mmitche <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a critical bug in the DownloadWithRetries function that prevented it from actually retrying downloads on most network errors. The original code had a logic flaw where the default case in the error handling switch statement would return immediately instead of continuing the retry loop, causing intermittent build failures when transient network errors like HTTP/2 stream errors occurred.
Key Changes:
- Fixed the default case in the error handling switch statement to sleep and continue retrying instead of returning immediately
- Preserved the special handling for HTTP 404 errors (exit code 22) to return immediately without retry
- Ensured transient network errors (like exit code 92 - HTTP/2 stream errors) now properly retry up to 5 times with 3-second delays
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/backport to release/10.0.1xx |
|
Started backporting to |
|
@mmitche backporting to git am output$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Creating an empty commit: Initial plan
Applying: Fix retry logic in DownloadWithRetries to properly retry on network errors
Using index info to reconstruct a base tree...
M eng/download-source-built-archive.sh
Falling back to patching base and 3-way merge...
Auto-merging eng/download-source-built-archive.sh
CONFLICT (content): Merge conflict in eng/download-source-built-archive.sh
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0002 Fix retry logic in DownloadWithRetries to properly retry on network errors
Error: The process '/usr/bin/git' failed with exit code 128 |
) Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: mmitche <[email protected]>
) Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: mmitche <[email protected]>
…3890) Co-authored-by: Copilot <[email protected]> Co-authored-by: mmitche <[email protected]>
#3858) (#3891) Co-authored-by: Copilot <[email protected]> Co-authored-by: mmitche <[email protected]>
Fix retry logic in DownloadWithRetries function
Issue Analysis
The
DownloadWithRetriesfunction ineng/download-source-built-archive.shhas a bug where it doesn't actually retry downloads for most error conditions. When curl fails with errors like exit code 92 (HTTP/2 stream error), the function immediately returns instead of retrying, leading to intermittent build failures.Root Cause
The case statement's default branch returns immediately for all non-404 exit codes:
Solution Implemented
Fixed the case statement by changing the default case to sleep and continue the loop instead of returning:
This ensures:
Impact
Changes
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.