npm installer: add timeout retry with exponential backoff#10
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR enhances the npm installer's download reliability by adding retry logic with exponential backoff for handling transient network failures. The installer downloads pre-built binaries from GitHub releases during the postinstall phase, and these improvements help ensure successful installation even under unstable network conditions.
Changes:
- Increased download timeout from 60s to 180s
- Added retry mechanism with up to 3 retries for transient failures
- Implemented exponential backoff (1s, 2s, 4s delays) between retry attempts
- Enhanced error handling to distinguish retriable vs non-retriable errors
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| npm/scripts/install.mjs | Refactored download function into retry wrapper and single-attempt function; added retry logic with exponential backoff; enhanced timeout and status code error handling |
| npm/README.md | Documented the new 180s timeout, retry count, and exponential backoff behavior |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
Changes
Validation
Notes