Skip to main content

Module interrupt

Module interrupt 

Source
Expand description

Cooperative SIGINT/SIGTERM handling so active test workers are stopped and reaped before cargo tmt exits.

Structs§

Interrupted
Error returned when execution stops due to SIGINT or SIGTERM.

Constants§

INTERRUPT_GRACE
Bounded grace period given to owned child process groups after SIGTERM on the first interrupt signal before escalating to SIGKILL.

Functions§

check
Returns Err(Interrupted) if a SIGINT or SIGTERM has been received.
exit_code
Process exit code corresponding to the first interrupting signal (143 for SIGTERM, 130 for SIGINT).
force_kill_requested
Returns true if a second (or subsequent) SIGINT/SIGTERM requested immediate SIGKILL escalation without waiting out the grace period.
install
Installs the process-wide SIGINT handler. Safe to call multiple times.
is_interrupted
Returns true once at least one SIGINT or SIGTERM has been received.
is_interrupted_err
Returns true if err (or any cause in its chain) is Interrupted.
signal_name
Name of the first interrupting signal received ("SIGTERM" or "SIGINT").