Skip to main content

Module process

Module process 

Source
Expand description

OS-level process utilities for robust server shutdown and stale process cleanup.

This module provides functions for checking process liveness, performing escalating kills (including process-group kills to handle wrapper scripts), and cleaning up stale pidfiles from crashed test runs.

All utilities are intentionally synchronous so they can be used from Drop implementations as well as from async startup paths.

Functionsยง

force_kill
Escalating kill: SIGTERM, wait grace period, then SIGKILL process group and individual PID.
kill_by_port
Kill any process listening on a TCP port via lsof.
pid_alive
Check if a process is alive via kill -0.
read_pidfile
Read a PID from a pidfile.