Skip to content

Commit 59e8f9c

Browse files
pzhan9meta-codesync[bot]
authored andcommitted
Make logs from spawn_exit_monitor part of ProcStatus (#1935)
Summary: Pull Request resolved: #1935 As title. This will be especially helpful when the process is forcefully killed by a signal, and the `Proc` did not get a chance to log any exit status. Reviewed By: shayne-fletcher Differential Revision: D87345385 fbshipit-source-id: ff9fbbdf43a5d153ecc4a412d51cedc7aac227cf
1 parent 199aff7 commit 59e8f9c

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

hyperactor_mesh/src/bootstrap.rs

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1741,35 +1741,47 @@ impl BootstrapProcManager {
17411741
if let Some(sig) = status.signal() {
17421742
let _ = handle.mark_killed(sig, status.core_dumped());
17431743
let pid_str = remove_from_pid_table();
1744-
tracing::debug!(
1744+
tracing::info!(
1745+
name = "ProcStatus",
1746+
status = "Exited::KilledBySignal",
1747+
%proc_id,
17451748
tail = tail_str,
1746-
"proc {proc_id} killed by signal {sig}; proc's pid: {pid_str}"
1749+
"killed by signal {sig}; proc's pid: {pid_str}"
17471750
);
17481751
} else if let Some(code) = status.code() {
17491752
let _ = handle.mark_stopped(code, stderr_tail);
17501753
let pid_str = remove_from_pid_table();
1751-
if code == 0 {
1752-
tracing::debug!(%proc_id, exit_code = code, tail = tail_str.as_deref(), "proc exited; proc's pid: {pid_str}");
1753-
} else {
1754-
tracing::info!(%proc_id, exit_code = code, tail = tail_str.as_deref(), "proc exited; proc's pid: {pid_str}");
1755-
}
1754+
tracing::info!(
1755+
name = "ProcStatus",
1756+
status = "Exited::ExitWithCode",
1757+
%proc_id,
1758+
exit_code = code,
1759+
tail = tail_str,
1760+
"proc exited; proc's pid: {pid_str}"
1761+
);
17561762
} else {
17571763
debug_assert!(
17581764
false,
17591765
"unreachable: process terminated with neither signal nor exit code"
17601766
);
17611767
let _ = handle.mark_failed("process exited with unknown status");
17621768
let pid_str = remove_from_pid_table();
1763-
tracing::error!(
1769+
tracing::info!(
1770+
name = "ProcStatus",
1771+
status = "Exited::Unknown",
1772+
%proc_id,
17641773
tail = tail_str,
1765-
"proc {proc_id} unknown exit: unreachable exit status (no code, no signal); proc's pid: {pid_str}"
1774+
"unknown exit: unreachable exit status (no code, no signal); proc's pid: {pid_str}"
17661775
);
17671776
}
17681777
}
17691778
Err(e) => {
17701779
let _ = handle.mark_failed(format!("wait_inner() failed: {e}"));
17711780
let pid_str = remove_from_pid_table();
17721781
tracing::info!(
1782+
name = "ProcStatus",
1783+
status = "Exited::WaitFailed",
1784+
%proc_id,
17731785
tail = tail_str,
17741786
"proc {proc_id} wait failed; proc's pid: {pid_str}"
17751787
);

0 commit comments

Comments
 (0)