保留进程控制通道失败正文
状态落盘失败和关闭流程记录终止或 shutdown 发送失败 补充进程会话排障记录
This commit is contained in:
@@ -261,9 +261,14 @@ where
|
||||
output.stdin_open = false;
|
||||
let reconciliation = process_session_record_from_live(&live, &output);
|
||||
let _ = write_process_session_record(root, &reconciliation);
|
||||
let _ = live.control.send(ProcessControl::Terminate);
|
||||
let terminate_error = live
|
||||
.control
|
||||
.send(ProcessControl::Terminate)
|
||||
.err()
|
||||
.map(|error| format!(";终止进程控制通道失败:{error}"))
|
||||
.unwrap_or_default();
|
||||
return Err(format!(
|
||||
"command.stdin 已写入但状态无法落盘,需要人工核对:{error}"
|
||||
"command.stdin 已写入但状态无法落盘,需要人工核对:{error}{terminate_error}"
|
||||
));
|
||||
}
|
||||
Ok(ProcessSessionStdinResult {
|
||||
@@ -355,7 +360,12 @@ pub(crate) fn mark_process_session_start_audit_failure_at(
|
||||
if let Ok(mut output) = live.output.lock() {
|
||||
output.launch_failure_kind = Some("start-audit-failed".to_string());
|
||||
}
|
||||
let _ = live.control.send(ProcessControl::Terminate);
|
||||
if let Err(terminate_error) = live.control.send(ProcessControl::Terminate) {
|
||||
app_log!(
|
||||
"process_session.terminate_after_start_audit_failed processId={} detail={terminate_error}",
|
||||
process_id
|
||||
);
|
||||
}
|
||||
}
|
||||
let mut record = read_process_session_record(root, process_id)?
|
||||
.ok_or_else(|| "command.start audit 失败后 process record 缺失".to_string())?;
|
||||
|
||||
@@ -162,7 +162,12 @@ pub(crate) fn shutdown_all_process_sessions() {
|
||||
.map(|registry| registry.sessions.values().cloned().collect::<Vec<_>>())
|
||||
.unwrap_or_default();
|
||||
for live in sessions {
|
||||
let _ = live.control.send(ProcessControl::Shutdown);
|
||||
if let Err(error) = live.control.send(ProcessControl::Shutdown) {
|
||||
app_log!(
|
||||
"process_session.shutdown.send_failed processId={} detail={error}",
|
||||
live.process_id
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user