{"record":{"id":"884e71a4d1dc7f42","repo":"abhigyanpatwari/GitNexus","slug":"worker-i-did-not-report-ready-after-attempt","errorCode":null,"errorMessage":"Worker ${i} did not report ready after ${attempt + 1} attempt(s); dropping slot.","messagePattern":"Worker (.+?) did not report ready after (.+?) attempt\\(s\\); dropping slot\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"gitnexus/src/core/ingestion/workers/worker-pool.ts","lineNumber":1291,"sourceCode":"        const msg = err instanceof Error ? err.message : String(err);\n        const sig = crashSignature(msg);\n        // Same signature as this slot's previous attempt => it survived a\n        // respawn, so retrying this slot is futile. (First crash has no prior\n        // signature, so attempt 0 never counts — every slot self-heals once.)\n        if (lastStartupSignature.get(i) === sig) reproducedStartupSlots.add(i);\n        lastStartupSignature.set(i, sig);\n        if (!anyWorkerReachedReady && reproducedStartupSlots.size >= deterministicSlotThreshold) {\n          deterministicStartupDetected = true;\n        }\n        await worker.terminate().catch(() => undefined);\n        workers[i] = undefined;\n\n        const giveUp =\n          terminated || deterministicStartupDetected || attempt >= STARTUP_RESTART_BUDGET;\n        if (giveUp) {\n          initialReadinessFailures.push(msg);\n          activeSlots.delete(i);\n          logger.warn(\n            { workerIndex: i, attempt, err: msg, deterministic: deterministicStartupDetected },\n            deterministicStartupDetected\n              ? `Worker ${i} hit a deterministic startup crash-loop; dropping slot without further retries.`\n              : `Worker ${i} did not report ready after ${attempt + 1} attempt(s); dropping slot.`,\n          );\n          return;\n        }\n        // Transient: jittered backoff, then respawn the slot and retry.\n        await abortableSleep(\n          startupBackoffMs(attempt),\n          () => terminated || deterministicStartupDetected,\n          pendingStartupTimers,\n        );\n        if (terminated || deterministicStartupDetected) {\n          initialReadinessFailures.push(msg);\n          activeSlots.delete(i);\n          return;\n        }","sourceCodeStart":1273,"sourceCodeEnd":1309,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/0d1aed942f0e8b5d3bac27519fff441aceea722d/gitnexus/src/core/ingestion/workers/worker-pool.ts#L1273-L1309","documentation":"Parsing workers must post a ready message after spawn; failing slots are respawned with jittered backoff up to STARTUP_RESTART_BUDGET (2) attempts. This warning fires when a slot exhausts that budget WITHOUT the deterministic-crash-signature detection triggering — the failures looked transient or had no reproducible signature — so the slot is dropped (activeSlots.delete(i)) and the pool continues with the remaining workers.","triggerScenarios":"Repeated but non-identical startup failures: a slow/overloaded machine where workers miss the readiness window with varying failure modes, intermittent OOM kills during grammar load (cold cache), CPU starvation in low-share containers, or nondeterministic crashes with different signatures each attempt.","commonSituations":"CI runners saturated by parallel jobs; first run after install while grammars are source-built (slow startup); containers with low CPU quota where ready messages arrive too late; antivirus scanning each spawned worker.","solutions":["Check the { err } (msg) and attempt fields in the log for the last failure mode","Reduce load on the machine (fewer parallel jobs) or increase the container CPU share, then re-run","Warm up before indexing: the first run after install builds/loads grammars — a retry often succeeds","Verify memory headroom if msg hints at OOM","If the same signature starts repeating from slot 0 on a fresh run, treat it as the deterministic case (error 398) and rebuild node_modules"],"exampleFix":"# before: analyze launched on a saturated CI box; workers miss the readiness window\nnpx gitnexus analyze  # -> slot dropped after retries\n\n# after: rerun when load drops, confirm slots come up\nuptime && npx gitnexus analyze","handlingStrategy":"retry","validationCode":"// preflight: spawn one worker and await ready before committing to a full analyze\nconst probe = pool.acquire();\nawait withTimeout(probe.ready, 30_000); // if this misses, the box is too loaded - run later\n","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run analyze when the machine is not saturated; low CPU-share containers routinely miss the readiness window","Expect a slower first run after install (grammar source-build) and simply retry once","Ensure memory headroom for grammar loading in each worker","If retries fail with the same signature from the first slot, switch to the deterministic-crash-loop playbook (rebuild node_modules)"],"tags":["worker-threads","startup","timeout","resource-exhaustion"],"backgroundTag":"worker-startup-timeout","analyzedSha":"0d1aed942f0e8b5d3bac27519fff441aceea722d","analyzedAt":"2026-08-20T23:29:22.980Z","contentChangedAt":"2026-08-20T23:29:22.980Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}