Currently, Ctrl-C sets the done flag and waits for in-flight tests to finish naturally. This is safe (no orphans) but slow if a test is stuck.
Proposed escalation
- 1st Ctrl-C: Set
done, stop picking new work, let in-flight phases finish (current behavior)
- 2nd Ctrl-C: Send SIGKILL to all child process groups, unblocking worker threads immediately
- 3rd Ctrl-C:
std::process::exit(1) as a last resort
This requires tracking spawned child PIDs in a global registry that the signal handler can access. The kill_process_tree function in phase.rs already uses SIGKILL on process groups, so the mechanism exists — it just needs to be callable from the handler.
Context
Children are spawned with process_group(0) so they're in their own process groups. SIGKILL to -pgid kills the entire group. This is already tested to work 3+ levels deep.
Currently, Ctrl-C sets the
doneflag and waits for in-flight tests to finish naturally. This is safe (no orphans) but slow if a test is stuck.Proposed escalation
done, stop picking new work, let in-flight phases finish (current behavior)std::process::exit(1)as a last resortThis requires tracking spawned child PIDs in a global registry that the signal handler can access. The
kill_process_treefunction inphase.rsalready usesSIGKILLon process groups, so the mechanism exists — it just needs to be callable from the handler.Context
Children are spawned with
process_group(0)so they're in their own process groups. SIGKILL to-pgidkills the entire group. This is already tested to work 3+ levels deep.