fix(ci): runner concurrency defaults to 1 — the 3-default self-DDoSed the box #5517
2 changed files+12−7
Modifiedsrc/__tests__/workflow-runner-concurrency.test.ts+2−2View fileUnifiedSplit
@@ -13,8 +13,8 @@ import { describe, expect, test } from "bun:test";
1313import { resolveWorkflowConcurrency } from "../lib/workflow-runner";
1414
1515describe("resolveWorkflowConcurrency", () => {
16 test("defaults to 3", () => {
17 expect(resolveWorkflowConcurrency({})).toBe(3);
16 test("defaults to 1 — serial; the 2026-08-22 default of 3 self-DDoSed the box", () => {
17 expect(resolveWorkflowConcurrency({})).toBe(1);
1818 });
1919
2020 test("honors WORKFLOW_CONCURRENCY", () => {
Modifiedsrc/lib/workflow-runner.ts+10−5View fileUnifiedSplit
@@ -1197,15 +1197,20 @@ export async function enqueueRun(opts: {
11971197// ---------------------------------------------------------------------------
11981198
11991199/**
1200 * How many runs may execute at once. One box, and the runner lives inside
1201 * the app container — so the default is deliberately small; this is
1202 * "stop being a strictly serial queue", not "be a build farm". Clamped so a
1203 * typo'd env value can't fork-bomb the container.
1200 * How many runs may execute at once. DEFAULT 1 (serial) — the 2026-08-22
1201 * default of 3 took production down three times in two hours: the runner
1202 * lives INSIDE the app container, so three concurrent full-suite CI runs
1203 * (4,670 tests each) starved the box's CPU until new TCP connections timed
1204 * out platform-wide while kernel ICMP still answered — which masqueraded
1205 * convincingly as a firewall wedge. Parallelism is real and works; raising
1206 * this is an explicit per-host decision (WORKFLOW_CONCURRENCY) for a host
1207 * whose runner has headroom the app doesn't pay for. Clamped so a typo'd
1208 * env value can't fork-bomb the container.
12041209 */
12051210export function resolveWorkflowConcurrency(
12061211 env: Record<string, string | undefined> = process.env
12071212): number {
1208 const n = Number(env.WORKFLOW_CONCURRENCY || 3);
1213 const n = Number(env.WORKFLOW_CONCURRENCY || 1);
12091214 if (!Number.isFinite(n) || n < 1) return 1;
12101215 return Math.min(Math.floor(n), 16);
12111216}
12121217
c comment · e edit title · m merge · a approve · r request changes · ? shortcuts