{"record":{"id":"22f22039255ab2d2","repo":"abhigyanpatwari/GitNexus","slug":"worker-workerindex-parse-job-idle-timeout-sing","errorCode":null,"errorMessage":"Worker ${workerIndex} parse job idle timeout (single item). Retrying with ${nextTimeout / 1000}s timeout.","messagePattern":"Worker (.+?) parse job idle timeout \\(single item\\)\\. Retrying with (.+?)s timeout\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"gitnexus/src/core/ingestion/workers/worker-pool.ts","lineNumber":1920,"sourceCode":"              workerIndex,\n              timeoutSec: job.timeoutMs / 1000,\n              items: job.items.length,\n              estimatedBytes: job.estimatedBytes,\n              lastProgress,\n              firstSplitItems: first.items.length,\n              secondSplitItems: second.items.length,\n              nextTimeoutSec: nextTimeout / 1000,\n            },\n            `Worker ${workerIndex} parse job idle timeout. Splitting into ${first.items.length}/${second.items.length} item jobs.`,\n          );\n          // Preserve intuitive retry order; final result order is still enforced by startIndex sort.\n          jobs.unshift(first, second);\n          return { kind: 'retry' };\n        }\n\n        const nextAttempt = job.attempt + 1;\n        if (nextAttempt <= poolOptions.maxTimeoutRetries) {\n          logger.warn(\n            {\n              workerIndex,\n              timeoutSec: job.timeoutMs / 1000,\n              attempt: nextAttempt,\n              maxAttempts: poolOptions.maxTimeoutRetries + 1,\n              nextTimeoutSec: nextTimeout / 1000,\n            },\n            `Worker ${workerIndex} parse job idle timeout (single item). Retrying with ${nextTimeout / 1000}s timeout.`,\n          );\n          jobs.unshift({\n            ...job,\n            attempt: nextAttempt,\n            timeoutMs: nextTimeout,\n            cumulativeTimeoutMs: nextCumulative,\n          });\n          return { kind: 'retry' };\n        }\n","sourceCodeStart":1902,"sourceCodeEnd":1938,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/0d1aed942f0e8b5d3bac27519fff441aceea722d/gitnexus/src/core/ingestion/workers/worker-pool.ts#L1902-L1938","documentation":"When a single-item job times out (nothing left to split) and retries remain (nextAttempt <= maxTimeoutRetries), the job is requeued with attempt+1 and a grown timeout (backoff factor applied). The warn shows the current timeout, the attempt as attempt/maxAttempts, and the next timeout in seconds — the last tolerated retry before quarantine.","triggerScenarios":"An idle timeout on a one-item job whose attempt counter is still under the retry budget: jobs.unshift({...job, attempt: nextAttempt, timeoutMs: nextTimeout, cumulativeTimeoutMs: nextCumulative}) requeues it with the escalated budget.","commonSituations":"A single slow-to-parse file (huge generated source, pathological nesting) that needs one or two bigger timeouts to finish; overloaded CI runners making first attempts miss; backoff factors too small for very large files.","solutions":["Usually no action — the retry with a larger timeout resolves one-off slowness; verify the next attempt succeeds in the logs","If the same file retraces this path every run, raise GITNEXUS_WORKER_SUB_BATCH_TIMEOUT_MS so the first attempt suffices","Watch the attempt counter: hitting maxAttempts hands over to the quarantine path, so pre-emptively exclude a known-pathological file","For systematically slow machines, scale the whole timeout family (sub-batch idle + cumulative budget) together"],"exampleFix":"# before\nexport GITNEXUS_WORKER_SUB_BATCH_TIMEOUT_MS=30000   # single item misses → repeated retry warns\n# after\nexport GITNEXUS_WORKER_SUB_BATCH_TIMEOUT_MS=120000  # first attempt succeeds, no retry","handlingStrategy":"retry","validationCode":"// Detect a file stuck on the retry ladder before it quarantines:\nconst retryWarns = [...logText.matchAll(/idle timeout \\(single item\\)\\. Retrying with (\\d+(?:\\.\\d+)?)s/g)];\nif (retryWarns.filter((m) => Number(m[1]) >= 60).length > 0) {\n  flagSlowParsers(extractRecentFiles(logText));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Raise the base sub-batch timeout on slow hardware so first attempts succeed","Watch attempt counts in the warns — hitting maxAttempts means quarantine is next","Exclude known-pathological files instead of letting them climb the backoff ladder every run"],"tags":["worker-pool","timeout","retry","backoff","parse-jobs"],"backgroundTag":"timeout-retry","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"}