Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions plugins/agy/scripts/lib/review-workload.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,26 @@ function acquireProviderWorkloadGate(file, env) {
release: () => releaseProviderWorkloadGate(gateDir, token),
});
} catch (error) {
if (error?.code !== "EEXIST") throw error;
if (tryReclaimProviderWorkloadGate(gateDir, env)) continue;
if (error?.code !== "EEXIST" && error?.code !== "ENOENT") throw error;
if (Date.now() >= deadline) {
return Object.freeze({
ok: false,
holder: parseGateOwner(readGateOwnerRaw(gateDir)),
});
}
// ENOENT from mkdirSync itself means the lock root (gateDir's parent) vanished
// under us — a concurrent teardown, not the gate-dir mid-acquire race. Reclaim
// would loop with no progress (renameSync also ENOENTs → true → continue), so
// re-establish the parent and sleep-pace: a persistently-missing root degrades
// to a bounded poll, never a CPU hot-loop. The race ENOENT instead comes from
// the owner-file open (syscall !== "mkdir") and falls through to reclaim, where
// the next mkdir succeeds.
if (error?.code === "ENOENT" && error?.syscall === "mkdir") {
try { mkdirSync(lockRoot(env), { recursive: true, mode: 0o700 }); } catch { /* best effort */ }
sleepSync(GATE_POLL_MS);
continue;
}
if (tryReclaimProviderWorkloadGate(gateDir, env)) continue;
sleepSync(GATE_POLL_MS);
}
Comment thread
seungpyoson marked this conversation as resolved.
}
Expand Down
16 changes: 14 additions & 2 deletions plugins/api-reviewers/scripts/lib/review-workload.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,26 @@ function acquireProviderWorkloadGate(file, env) {
release: () => releaseProviderWorkloadGate(gateDir, token),
});
} catch (error) {
if (error?.code !== "EEXIST") throw error;
if (tryReclaimProviderWorkloadGate(gateDir, env)) continue;
if (error?.code !== "EEXIST" && error?.code !== "ENOENT") throw error;
if (Date.now() >= deadline) {
return Object.freeze({
ok: false,
holder: parseGateOwner(readGateOwnerRaw(gateDir)),
});
}
// ENOENT from mkdirSync itself means the lock root (gateDir's parent) vanished
// under us — a concurrent teardown, not the gate-dir mid-acquire race. Reclaim
// would loop with no progress (renameSync also ENOENTs → true → continue), so
// re-establish the parent and sleep-pace: a persistently-missing root degrades
// to a bounded poll, never a CPU hot-loop. The race ENOENT instead comes from
// the owner-file open (syscall !== "mkdir") and falls through to reclaim, where
// the next mkdir succeeds.
if (error?.code === "ENOENT" && error?.syscall === "mkdir") {
try { mkdirSync(lockRoot(env), { recursive: true, mode: 0o700 }); } catch { /* best effort */ }
sleepSync(GATE_POLL_MS);
continue;
}
if (tryReclaimProviderWorkloadGate(gateDir, env)) continue;
sleepSync(GATE_POLL_MS);
}
Comment thread
seungpyoson marked this conversation as resolved.
}
Expand Down
16 changes: 14 additions & 2 deletions plugins/claude/scripts/lib/review-workload.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,26 @@ function acquireProviderWorkloadGate(file, env) {
release: () => releaseProviderWorkloadGate(gateDir, token),
});
} catch (error) {
if (error?.code !== "EEXIST") throw error;
if (tryReclaimProviderWorkloadGate(gateDir, env)) continue;
if (error?.code !== "EEXIST" && error?.code !== "ENOENT") throw error;
if (Date.now() >= deadline) {
return Object.freeze({
ok: false,
holder: parseGateOwner(readGateOwnerRaw(gateDir)),
});
}
// ENOENT from mkdirSync itself means the lock root (gateDir's parent) vanished
// under us — a concurrent teardown, not the gate-dir mid-acquire race. Reclaim
// would loop with no progress (renameSync also ENOENTs → true → continue), so
// re-establish the parent and sleep-pace: a persistently-missing root degrades
// to a bounded poll, never a CPU hot-loop. The race ENOENT instead comes from
// the owner-file open (syscall !== "mkdir") and falls through to reclaim, where
// the next mkdir succeeds.
if (error?.code === "ENOENT" && error?.syscall === "mkdir") {
try { mkdirSync(lockRoot(env), { recursive: true, mode: 0o700 }); } catch { /* best effort */ }
sleepSync(GATE_POLL_MS);
continue;
}
if (tryReclaimProviderWorkloadGate(gateDir, env)) continue;
sleepSync(GATE_POLL_MS);
}
Comment thread
seungpyoson marked this conversation as resolved.
}
Expand Down
16 changes: 14 additions & 2 deletions plugins/gemini/scripts/lib/review-workload.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,26 @@ function acquireProviderWorkloadGate(file, env) {
release: () => releaseProviderWorkloadGate(gateDir, token),
});
} catch (error) {
if (error?.code !== "EEXIST") throw error;
if (tryReclaimProviderWorkloadGate(gateDir, env)) continue;
if (error?.code !== "EEXIST" && error?.code !== "ENOENT") throw error;
if (Date.now() >= deadline) {
return Object.freeze({
ok: false,
holder: parseGateOwner(readGateOwnerRaw(gateDir)),
});
}
// ENOENT from mkdirSync itself means the lock root (gateDir's parent) vanished
// under us — a concurrent teardown, not the gate-dir mid-acquire race. Reclaim
// would loop with no progress (renameSync also ENOENTs → true → continue), so
// re-establish the parent and sleep-pace: a persistently-missing root degrades
// to a bounded poll, never a CPU hot-loop. The race ENOENT instead comes from
// the owner-file open (syscall !== "mkdir") and falls through to reclaim, where
// the next mkdir succeeds.
if (error?.code === "ENOENT" && error?.syscall === "mkdir") {
try { mkdirSync(lockRoot(env), { recursive: true, mode: 0o700 }); } catch { /* best effort */ }
sleepSync(GATE_POLL_MS);
continue;
}
if (tryReclaimProviderWorkloadGate(gateDir, env)) continue;
sleepSync(GATE_POLL_MS);
}
Comment thread
seungpyoson marked this conversation as resolved.
}
Expand Down
16 changes: 14 additions & 2 deletions plugins/grok/scripts/lib/review-workload.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,26 @@ function acquireProviderWorkloadGate(file, env) {
release: () => releaseProviderWorkloadGate(gateDir, token),
});
} catch (error) {
if (error?.code !== "EEXIST") throw error;
if (tryReclaimProviderWorkloadGate(gateDir, env)) continue;
if (error?.code !== "EEXIST" && error?.code !== "ENOENT") throw error;
if (Date.now() >= deadline) {
return Object.freeze({
ok: false,
holder: parseGateOwner(readGateOwnerRaw(gateDir)),
});
}
// ENOENT from mkdirSync itself means the lock root (gateDir's parent) vanished
// under us — a concurrent teardown, not the gate-dir mid-acquire race. Reclaim
// would loop with no progress (renameSync also ENOENTs → true → continue), so
// re-establish the parent and sleep-pace: a persistently-missing root degrades
// to a bounded poll, never a CPU hot-loop. The race ENOENT instead comes from
// the owner-file open (syscall !== "mkdir") and falls through to reclaim, where
// the next mkdir succeeds.
if (error?.code === "ENOENT" && error?.syscall === "mkdir") {
try { mkdirSync(lockRoot(env), { recursive: true, mode: 0o700 }); } catch { /* best effort */ }
sleepSync(GATE_POLL_MS);
continue;
}
if (tryReclaimProviderWorkloadGate(gateDir, env)) continue;
sleepSync(GATE_POLL_MS);
}
Comment thread
seungpyoson marked this conversation as resolved.
}
Expand Down
16 changes: 14 additions & 2 deletions plugins/kimi/scripts/lib/review-workload.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,26 @@ function acquireProviderWorkloadGate(file, env) {
release: () => releaseProviderWorkloadGate(gateDir, token),
});
} catch (error) {
if (error?.code !== "EEXIST") throw error;
if (tryReclaimProviderWorkloadGate(gateDir, env)) continue;
if (error?.code !== "EEXIST" && error?.code !== "ENOENT") throw error;
if (Date.now() >= deadline) {
return Object.freeze({
ok: false,
holder: parseGateOwner(readGateOwnerRaw(gateDir)),
});
}
// ENOENT from mkdirSync itself means the lock root (gateDir's parent) vanished
// under us — a concurrent teardown, not the gate-dir mid-acquire race. Reclaim
// would loop with no progress (renameSync also ENOENTs → true → continue), so
// re-establish the parent and sleep-pace: a persistently-missing root degrades
// to a bounded poll, never a CPU hot-loop. The race ENOENT instead comes from
// the owner-file open (syscall !== "mkdir") and falls through to reclaim, where
// the next mkdir succeeds.
if (error?.code === "ENOENT" && error?.syscall === "mkdir") {
try { mkdirSync(lockRoot(env), { recursive: true, mode: 0o700 }); } catch { /* best effort */ }
sleepSync(GATE_POLL_MS);
continue;
}
if (tryReclaimProviderWorkloadGate(gateDir, env)) continue;
sleepSync(GATE_POLL_MS);
}
Comment thread
seungpyoson marked this conversation as resolved.
}
Expand Down
16 changes: 14 additions & 2 deletions relay/relay-agy/scripts/lib/review-workload.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,26 @@ function acquireProviderWorkloadGate(file, env) {
release: () => releaseProviderWorkloadGate(gateDir, token),
});
} catch (error) {
if (error?.code !== "EEXIST") throw error;
if (tryReclaimProviderWorkloadGate(gateDir, env)) continue;
if (error?.code !== "EEXIST" && error?.code !== "ENOENT") throw error;
if (Date.now() >= deadline) {
return Object.freeze({
ok: false,
holder: parseGateOwner(readGateOwnerRaw(gateDir)),
});
}
// ENOENT from mkdirSync itself means the lock root (gateDir's parent) vanished
// under us — a concurrent teardown, not the gate-dir mid-acquire race. Reclaim
// would loop with no progress (renameSync also ENOENTs → true → continue), so
// re-establish the parent and sleep-pace: a persistently-missing root degrades
// to a bounded poll, never a CPU hot-loop. The race ENOENT instead comes from
// the owner-file open (syscall !== "mkdir") and falls through to reclaim, where
// the next mkdir succeeds.
if (error?.code === "ENOENT" && error?.syscall === "mkdir") {
try { mkdirSync(lockRoot(env), { recursive: true, mode: 0o700 }); } catch { /* best effort */ }
sleepSync(GATE_POLL_MS);
continue;
}
if (tryReclaimProviderWorkloadGate(gateDir, env)) continue;
sleepSync(GATE_POLL_MS);
}
Comment thread
seungpyoson marked this conversation as resolved.
}
Expand Down
16 changes: 14 additions & 2 deletions relay/relay-gemini/scripts/lib/review-workload.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,26 @@ function acquireProviderWorkloadGate(file, env) {
release: () => releaseProviderWorkloadGate(gateDir, token),
});
} catch (error) {
if (error?.code !== "EEXIST") throw error;
if (tryReclaimProviderWorkloadGate(gateDir, env)) continue;
if (error?.code !== "EEXIST" && error?.code !== "ENOENT") throw error;
if (Date.now() >= deadline) {
return Object.freeze({
ok: false,
holder: parseGateOwner(readGateOwnerRaw(gateDir)),
});
}
// ENOENT from mkdirSync itself means the lock root (gateDir's parent) vanished
// under us — a concurrent teardown, not the gate-dir mid-acquire race. Reclaim
// would loop with no progress (renameSync also ENOENTs → true → continue), so
// re-establish the parent and sleep-pace: a persistently-missing root degrades
// to a bounded poll, never a CPU hot-loop. The race ENOENT instead comes from
// the owner-file open (syscall !== "mkdir") and falls through to reclaim, where
// the next mkdir succeeds.
if (error?.code === "ENOENT" && error?.syscall === "mkdir") {
try { mkdirSync(lockRoot(env), { recursive: true, mode: 0o700 }); } catch { /* best effort */ }
sleepSync(GATE_POLL_MS);
continue;
}
if (tryReclaimProviderWorkloadGate(gateDir, env)) continue;
sleepSync(GATE_POLL_MS);
}
Comment thread
seungpyoson marked this conversation as resolved.
}
Expand Down
16 changes: 14 additions & 2 deletions relay/relay-grok/scripts/lib/review-workload.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,26 @@ function acquireProviderWorkloadGate(file, env) {
release: () => releaseProviderWorkloadGate(gateDir, token),
});
} catch (error) {
if (error?.code !== "EEXIST") throw error;
if (tryReclaimProviderWorkloadGate(gateDir, env)) continue;
if (error?.code !== "EEXIST" && error?.code !== "ENOENT") throw error;
if (Date.now() >= deadline) {
return Object.freeze({
ok: false,
holder: parseGateOwner(readGateOwnerRaw(gateDir)),
});
}
// ENOENT from mkdirSync itself means the lock root (gateDir's parent) vanished
// under us — a concurrent teardown, not the gate-dir mid-acquire race. Reclaim
// would loop with no progress (renameSync also ENOENTs → true → continue), so
// re-establish the parent and sleep-pace: a persistently-missing root degrades
// to a bounded poll, never a CPU hot-loop. The race ENOENT instead comes from
// the owner-file open (syscall !== "mkdir") and falls through to reclaim, where
// the next mkdir succeeds.
if (error?.code === "ENOENT" && error?.syscall === "mkdir") {
try { mkdirSync(lockRoot(env), { recursive: true, mode: 0o700 }); } catch { /* best effort */ }
sleepSync(GATE_POLL_MS);
continue;
}
if (tryReclaimProviderWorkloadGate(gateDir, env)) continue;
sleepSync(GATE_POLL_MS);
}
Comment thread
seungpyoson marked this conversation as resolved.
}
Expand Down
16 changes: 14 additions & 2 deletions relay/relay-kimi/scripts/lib/review-workload.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,26 @@ function acquireProviderWorkloadGate(file, env) {
release: () => releaseProviderWorkloadGate(gateDir, token),
});
} catch (error) {
if (error?.code !== "EEXIST") throw error;
if (tryReclaimProviderWorkloadGate(gateDir, env)) continue;
if (error?.code !== "EEXIST" && error?.code !== "ENOENT") throw error;
if (Date.now() >= deadline) {
return Object.freeze({
ok: false,
holder: parseGateOwner(readGateOwnerRaw(gateDir)),
});
}
// ENOENT from mkdirSync itself means the lock root (gateDir's parent) vanished
// under us — a concurrent teardown, not the gate-dir mid-acquire race. Reclaim
// would loop with no progress (renameSync also ENOENTs → true → continue), so
// re-establish the parent and sleep-pace: a persistently-missing root degrades
// to a bounded poll, never a CPU hot-loop. The race ENOENT instead comes from
// the owner-file open (syscall !== "mkdir") and falls through to reclaim, where
// the next mkdir succeeds.
if (error?.code === "ENOENT" && error?.syscall === "mkdir") {
try { mkdirSync(lockRoot(env), { recursive: true, mode: 0o700 }); } catch { /* best effort */ }
sleepSync(GATE_POLL_MS);
continue;
}
if (tryReclaimProviderWorkloadGate(gateDir, env)) continue;
sleepSync(GATE_POLL_MS);
}
Comment thread
seungpyoson marked this conversation as resolved.
}
Expand Down
16 changes: 14 additions & 2 deletions scripts/lib/review-workload.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,26 @@ function acquireProviderWorkloadGate(file, env) {
release: () => releaseProviderWorkloadGate(gateDir, token),
});
} catch (error) {
if (error?.code !== "EEXIST") throw error;
if (tryReclaimProviderWorkloadGate(gateDir, env)) continue;
if (error?.code !== "EEXIST" && error?.code !== "ENOENT") throw error;
if (Date.now() >= deadline) {
return Object.freeze({
ok: false,
holder: parseGateOwner(readGateOwnerRaw(gateDir)),
});
}
// ENOENT from mkdirSync itself means the lock root (gateDir's parent) vanished
// under us — a concurrent teardown, not the gate-dir mid-acquire race. Reclaim
// would loop with no progress (renameSync also ENOENTs → true → continue), so
// re-establish the parent and sleep-pace: a persistently-missing root degrades
// to a bounded poll, never a CPU hot-loop. The race ENOENT instead comes from
// the owner-file open (syscall !== "mkdir") and falls through to reclaim, where
// the next mkdir succeeds.
if (error?.code === "ENOENT" && error?.syscall === "mkdir") {
try { mkdirSync(lockRoot(env), { recursive: true, mode: 0o700 }); } catch { /* best effort */ }
sleepSync(GATE_POLL_MS);
continue;
}
if (tryReclaimProviderWorkloadGate(gateDir, env)) continue;
sleepSync(GATE_POLL_MS);
}
Comment thread
seungpyoson marked this conversation as resolved.
}
Expand Down
Loading
Loading