fix: handle process exit in waitForProcessesExit filter

The process.kill(pid, 0) call throws when a process has exited,
which crashed the filter callback. Wrapped in try/catch to
correctly return false for exited processes.

Fixes critical bug found in PR #458 review (Phase 1).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Alex Newman
2025-12-26 20:48:15 -05:00
parent 85bd88f110
commit 77ceca7a6e
+6 -2
View File
@@ -754,8 +754,12 @@ export class WorkerService {
while (Date.now() - start < timeoutMs) {
const stillAlive = pids.filter(pid => {
process.kill(pid, 0); // Signal 0 checks if process exists - throws if dead
return true;
try {
process.kill(pid, 0);
return true;
} catch {
return false;
}
});
if (stillAlive.length === 0) {