Skip to main content

Module tree_run

Module tree_run 

Source
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)).
run
Run argv in cwd until it exits, deadline passes, or cancel is set.
run_output
run, returning the tool’s output (its last lines) on success — for a bounded, cancellable probe such as <tool> --version.