Expand description
Running one tree gate’s command with a deadline (ADR-0024).
A tree gate is optional work beside the commit’s real checks, so it must never outlive the time it was given, and never leave anything running when it is stopped:
- it runs in its own process group, reniced so it yields CPU to the mandatory checks;
- it has a hard deadline and a cancel flag (the dispatcher sets it when the slack after the mandatory checks runs out);
- on either, the whole group is killed (TERM, then KILL) before this returns, so a lock held for the run is released only once nothing that could still write the cache is alive.
The outcome is richer than common::run_quiet’s bool. The caller needs to
tell a lint failure (withhold the stamp, say how many problems) from a
timeout or a cancel (the cache was not proven cold or warm) from a tool that
could not start.
Enums§
- TreeRun
- How a tree gate’s run ended.
Functions§
- group_
alive - Whether any process of the group is still alive (
kill(-pgid, 0)). - reap_
live - Kill every tree gate still running: TERM, the same grace as a timeout, then KILL. Called by the signal watcher in ordinary thread context, never from the handler itself. A no-op when no gate runs.
- run
- Run
argvincwduntil it exits,deadlinepasses, orcancelis set. - run_
output run, returning the tool’s output (its last lines) on success — for a bounded, cancellable probe such as<tool> --version.