修复进程会话终止清理竞态
在发布终态通知前先移除 live registry 会话\n避免取消清理瞬时误判仍有未收束进程
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user