Skip to content

npm installer: add timeout retry with exponential backoff#10

Merged
Miss-you merged 3 commits into
mainfrom
fix/npm-install-timeout-retry-backoff
Feb 23, 2026
Merged

npm installer: add timeout retry with exponential backoff#10
Miss-you merged 3 commits into
mainfrom
fix/npm-install-timeout-retry-backoff

Conversation

@Miss-you

Copy link
Copy Markdown
Owner

Summary

  • increase npm postinstall download timeout from 60s to 180s
  • add retry logic for transient network failures (up to 3 retries)
  • add exponential backoff between retries (1s, 2s, 4s)

Changes

  • npm/scripts/install.mjs
    • split download into single-attempt and retry wrapper
    • retry on timeout/network errors and HTTP retriable status codes (408/425/429/5xx)
    • keep redirect handling and checksum verification flow unchanged
  • npm/README.md
    • document timeout + retry + backoff behavior

Validation

  • make test
  • make lint
  • make vet
  • make build
  • node --check npm/scripts/install.mjs

Notes

  • only npm installer files were committed; unrelated untracked local directories were not included.

Copilot AI review requested due to automatic review settings February 23, 2026 13:59

Copilot AI left a comment

Copy link
Copy Markdown

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

Comment thread npm/scripts/install.mjs Outdated
@Miss-you
Miss-you merged commit f3df31b into main Feb 23, 2026
7 checks passed
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.

2 participants