Repository navigation
Conversation
The npm ci command in emsdk.proj has no retry logic, causing transient network failures (ETIMEDOUT, connection refused, etc.) to fail the entire build. Unlike HTTP-level errors that npm retries internally, TCP connection timeouts are not retried. Add a shell-level retry wrapper that attempts npm ci up to 3 times with 10-second delays between attempts, handling both Windows and Unix platforms. Fixes build failures like dnceng/internal build 2925361 where npm ci timed out connecting to Azure blob storage for package downloads. Co-authored-by: Copilot <[email protected]>
|
We should do better with the retry code, but the pattern is good. We could just settle on npm retries, but I want a catch-all. |
|
we haven't seen this fail again so far and the logic is quite ugly so I'd prefer holding off on this, but happy to reevaluate if it happens again. |
|
npm/make-fetch-happen#27 suggests that these TCP connection errors are retried. |
If I remember the original analysis with this bug, there are certain kinds of network failures that aren't retried. I'm ok with the lowest touch to start. I think we should at least try something. |
|
yeah what I'm saying is the issue and this code claims they are retried: https://github.com/npm/make-fetch-happen/blob/c389a1e567327359aa4b34dbf805989ecbd9755b/index.js#L21-L28 |
|
I'll close this again and we can revisit if need be. |
Summary
The
npm cicommand inemsdk.projhas no retry logic, causing transient network failures (ETIMEDOUT, connection refused, etc.) to fail the entire build.Problem
Build 2925361 (main, Mar 12) failed because
npm citimed out connecting to Azure blob storage (vsblob.vsassets.io:443):Unlike HTTP-level errors that npm retries internally via
--fetch-retries, TCP connection timeouts (ETIMEDOUT) are not retried by npm.Fix
Add a shell-level retry wrapper that attempts
npm ciup to 3 times with 10-second delays between attempts. Handles both Windows (timeout /t 10) and Unix (sleep 10).This is the same pattern used for other transient network operations in the build (e.g., curl retries for wasi-sdk downloads in runtime#125488).
cc @lewing