forked from meta-pytorch/monarch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit 8787265
: bootstrap: integrate ProcHandle in BootstrapProcManager (meta-pytorch#1282)
Summary:
integrates the `ProcStatus` / `ProcHandle` lifecycle surface into `BootstrapProcManager`. the manager now stores `ProcHandle`s instead of raw `Child`s, stamps `Running` on `spawn` when a pid is observable, wires `stdout`/`stderr` to `BOOTSTRAP_LOG_CHANNEL`, and runs an exit monitor that `wait()`s and records `Stopped(code)` or `Killed(signal, core_dumped)` via `ExitStatusExt`. illegal transitions are rejected and the `mark_*`s return `bool` to make that explicit in tests.
adds `BootstrapProcManager::status(&ProcId)` for a snapshot of the current status. documents constructors, `transport()` (Unix), and clarifies `mark_running` as a best-effort OS-level liveness stamp, not a readiness guarantee.
adds a `pid_table` and a `Drop` impl that best-effort `SIGKILL`s recorded pids on `drop`. this replaces relying on `Child.kill_on_drop` now that the exit monitor owns the `Child`.
tests exercise handle transitions, clean exit and `SIGKILL` observed by the monitor, unknown-proc status, the “child already taken” path, pid disappearing once the monitor claims the child, and the fast-exit path that goes `Starting` -> `Stopped` without `Running`. the manager-drop test now tolerates linux zombie semantics by polling `/proc/<pid>/status` and accepting `Z` or disappearance. includes an unsafe justification for `libc::kill` in the `SIGKILL` test.
graceful shutdown (SIGTERM → wait → SIGKILL) remains a TODO. tombstone semantics in children are unchanged for now.
Differential Revision: D828462061 parent 716eb5e commit 8787265Copy full SHA for 8787265
File tree
Expand file treeCollapse file tree
1 file changed
+472
-42
lines changedFilter options
- hyperactor_mesh/src
Expand file treeCollapse file tree
1 file changed
+472
-42
lines changed
0 commit comments