* The base timer fired with no result processed yet. Do NOT kill or settle: * the timer firing doesn't prove the parse is still running — after a long * synchronous main-thread stretch Node services the timers phase before the * poll phase, so an already-delivered `parse-result` is still qu
(w: ParsePoolWorker, job: ParseJob, ms: number)
| 386 | * and arm the hard-kill backstop for workers that are genuinely hung. |
| 387 | */ |
| 388 | private onTimeout(w: ParsePoolWorker, job: ParseJob, ms: number): void { |
| 389 | if (job.settled || !this.workers.has(w)) return; |
| 390 | const graceMs = ms * (HARD_KILL_MULTIPLIER - 1); |
| 391 | this.log(`TIMEOUT: ${job.task.filePath} exceeded ${ms}ms with no result — waiting up to ${graceMs}ms more for a late result before killing the worker`); |
| 392 | job.timerExpired = true; |
| 393 | job.hardKillTimer = setTimeout(() => this.onHardTimeout(w, job, ms * HARD_KILL_MULTIPLIER), graceMs); |
| 394 | job.hardKillTimer.unref?.(); |
| 395 | } |
| 396 | |
| 397 | /** No result after the full hard-kill window — the worker really is hung. */ |
| 398 | private onHardTimeout(w: ParsePoolWorker, job: ParseJob, totalMs: number): void { |
no test coverage detected