修复进程会话终止清理竞态
Project CI / Repository checks (push) Successful in 52s
Project CI / Frontend tests (push) Successful in 2m46s
Project CI / Backend tests (push) Successful in 4m6s
Project CI / Native shell tests (push) Successful in 14m34s

在发布终态通知前先移除 live registry 会话\n避免取消清理瞬时误判仍有未收束进程
This commit is contained in:
2026-08-08 22:33:55 +08:00
parent 8d4d7ecc95
commit dfcd67bd05
@@ -1435,11 +1435,13 @@ fn finalize_live_process_session(
output.needs_reconciliation = true;
}
let needs_reconciliation = output.needs_reconciliation;
live.output_changed.notify_all();
drop(output);
// 只有 live registry 已收束后才能发布可信终态。等待 `output_changed` 的调用方
// 可能立即执行 run 级取消清理,而 registry 中的任何 live 条目都会被视为未完成会话。
if record_persisted && !needs_reconciliation {
if let Ok(mut registry) = process_session_registry().lock() {
registry.sessions.remove(&live.process_id);
}
}
live.output_changed.notify_all();
drop(output);
}