fix: no-ctl threads should be failed, not active

小橘 <xiaoju@shazhou.work>
This commit is contained in:
2026-05-10 01:36:14 +00:00
parent fede623a82
commit 064a24f093
+9 -7
View File
@@ -232,13 +232,15 @@ export async function resolveThreadListStatus(
}
// No .running marker + no __end__ + source "active" → check if worker is dead (crashed)
const ctlResult = await readWorkerCtl(storageRoot, row.hash);
if (ctlResult.ok) {
try {
process.kill(ctlResult.value.pid, 0);
} catch {
// Worker PID is dead, thread never finished — crashed
return "failed";
}
if (!ctlResult.ok) {
// No ctl file means worker never registered or was already cleaned up — dead thread
return "failed";
}
try {
process.kill(ctlResult.value.pid, 0);
} catch {
// Worker PID is dead, thread never finished — crashed
return "failed";
}
return "active";
}