Skip to content

Commit 9d7fb47

Browse files
committed
build: add retry-delay for accept4 failed 110
This error is still being unencountered sometimes, to try to mitigate this we add a retry delay and also increase the number of retries. ``` Could not convert symlinks: Error: Command failed: /mnt/c/Windows/system32/cmd.exe /c mklink /d "_main\node_modules\.aspect_rules_js\[email protected]\node_modules\encodeurl" "..\..\[email protected]\node_modules\encodeurl" <3>WSL (22769 - ) ERROR: UtilAcceptVsock:271: accept4 failed 110 ``` (cherry picked from commit dfc334c)
1 parent 3482633 commit 9d7fb47

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

scripts/windows-testing/convert-symlinks.mjs

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.dev/license
7+
*/
8+
19
/**
210
* @fileoverview Script that takes a directory and converts all its Unix symlinks
311
* to relative Windows-compatible symlinks. This is necessary because when building
@@ -13,14 +21,12 @@
1321
* - https://pnpm.io/symlinked-node-modules-structure.
1422
*/
1523

16-
import path from 'node:path';
17-
import fs from 'node:fs/promises';
1824
import childProcess from 'node:child_process';
25+
import fs from 'node:fs/promises';
26+
import path from 'node:path';
1927

2028
const [rootDir, cmdPath] = process.argv.slice(2);
2129

22-
// GitHub actions can set this environment variable when pressing the "re-run" button.
23-
const debug = process.env.ACTIONS_STEP_DEBUG === 'true';
2430
const skipDirectories = [
2531
// Modules that we don't need and would unnecessarily slow-down this.
2632
'_windows_amd64/bin/nodejs/node_modules',
@@ -87,7 +93,7 @@ async function transformDir(p) {
8793
await Promise.all(directoriesToVisit.map((d) => transformDir(d)));
8894
}
8995

90-
function exec(cmd, maxRetries = 3) {
96+
function exec(cmd, maxRetries = 5, retryDelay = 200) {
9197
return new Promise((resolve, reject) => {
9298
childProcess.exec(cmd, { cwd: rootDir }, (error) => {
9399
if (error !== null) {
@@ -99,7 +105,11 @@ function exec(cmd, maxRetries = 3) {
99105
error.stderr !== undefined &&
100106
error.stderr.includes(`accept4 failed 110`)
101107
) {
102-
resolve(exec(cmd, maxRetries - 1));
108+
// Add a small delay before the retry
109+
setTimeout(() => {
110+
resolve(exec(cmd, maxRetries - 1, retryDelay));
111+
}, retryDelay);
112+
103113
return;
104114
}
105115

scripts/windows-testing/parallel-executor.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.dev/license
7+
*/
8+
19
import * as child_process from 'node:child_process';
210
import path from 'node:path';
311
import { stripVTControlCharacters } from 'node:util';

0 commit comments

Comments
 (0)