Expand description
Owned processes: every child is spawned through rightkit-child-process (process
group / Job Object), registered with a Tracker, and killed by recorded pid
only. Nothing here ever matches processes by name for killing.
Structs§
- Output
- RunOptions
- Tracker
- Registry of every pid a run started, so the run can assert nothing leaked.
Constants§
- KILL_
HELPER_ TIMEOUT - Longest a kill helper (
taskkill,kill,pgrep, …) may run before it is abandoned. - TERMINATE_
REAP_ TIMEOUT - Longest a process-tree termination may wait to reap the leader.
Functions§
- fingerprint
pscommand line for a pid (unix); the fingerprint that makes a recorded pid safe to kill later without risking an unrelated process that reused it.- is_
alive - kill_
tree - Terminate
pidand its descendants. TERM first, KILL after a short grace. - kill_
with_ fallback - Run a kill helper (e.g.
taskkill) bounded bytimeout. When it cannot finish (it overran, or could not start)fallback(pid)runs instead (TerminateProcesson Windows) and a note for the run log is returned;Nonemeans the helper finished. Never blocks longer thantimeoutplus the helper reap. - output_
bounded - Run a command for its captured output, waiting at most
timeout(pipe draining is bounded too, so a descendant holding a pipe open cannot hang the caller).Ok(None)means it timed out and was killed. Stdin is null. - run_
owned - Run to completion with a hard deadline; on timeout the whole tree is killed.
- status_
bounded - Run a command to completion for its exit status, waiting at most
timeout. The command is killed when it overruns.Ok(None)means it timed out. The caller sets stdio. - sweep_
registries - Kill processes recorded by earlier runs that are still alive AND still have the exact command line that was recorded. Returns the pids killed.
- terminate_
bounded - Terminate an owned child’s tree, waiting at most
TERMINATE_REAP_TIMEOUTfor the leader to be reaped. Returns the exit status when reaped and a run-log note when it was not.