Skip to main content

Module process

Module process 

Source
Expand description

Process lifecycle management for the agent daemon.

Initializing ProcessManager transfers process-wide child-status ownership to its dedicated thread: it drains waitpid(-1, WNOHANG) and therefore also consumes statuses for untracked children. Code that needs an exit status must acquire ProcessManager::spawn_guard before creating the process and finish with ProcessSpawnGuard::track. It must not independently wait on the same child PID during normal operation. Terminal teardown is the deliberate exception: it may reap any remaining child directly when the manager itself can no longer be assumed healthy.

Structsยง

ProcessExitWatcher
Observes the eventual exit code of a tracked process.
ProcessIdentity
Stable identity for one registration of an operating-system PID.
ProcessManager
Coordinates process spawning, exit observation, and process-wide child reaping.
ProcessSpawnGuard
Keeps process reaping paused until a newly spawned PID is tracked.