fix: replace shell sleep with cross-platform Atomics.wait in planning lock (#1693)
Fixes #1692 spawnSync('sleep', ['0.1']) fails silently on Windows (ENOENT), causing a tight busy-loop during lock contention. Atomics.wait() provides a cross-platform 100ms blocking wait available in Node 22+.
This commit is contained in:
@@ -581,8 +581,8 @@ function withPlanningLock(cwd, fn) {
|
|||||||
}
|
}
|
||||||
} catch { continue; }
|
} catch { continue; }
|
||||||
|
|
||||||
// Wait and retry
|
// Wait and retry (cross-platform, no shell dependency)
|
||||||
spawnSync('sleep', ['0.1'], { stdio: 'ignore' });
|
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, 100);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
throw err;
|
throw err;
|
||||||
|
|||||||
Reference in New Issue
Block a user