Skip to content

Commit 1048daf

Browse files
committed
Fix concurrent daemon startup race condition
When two CLI processes race to start a daemon, the loser's child exits after failing to acquire the lock. Previously ensureDaemonClient gave up immediately on child exit. Now it continues polling for ~1s to discover the winning daemon before failing.
1 parent 6e28a6e commit 1048daf

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

apps/hook/server/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ async function ensureDaemonClient(options: { pluginError?: boolean } = {}) {
546546
if (daemon.code !== "missing" && daemon.code !== "stale") {
547547
lastStartProblem = daemon;
548548
}
549-
if (startExit) {
549+
if (startExit && attempt >= 10) {
550550
const log = await readDaemonStartLog(startLogPath);
551551
const detail = startExit.error instanceof Error
552552
? startExit.error.message

0 commit comments

Comments
 (0)