Expand description
Starting real processes for attempts and parse jobs: the runner with its end of a fresh socket pair, commands as they are, each supervised (timeout, cancel, SIGTERM then SIGKILL).
A runner gets its channel to the agent as an inherited, already connected socket
(SCHEDR_AGENT_FD), not a path to connect to: no socket file, no directory, no path-length
limit, and no other process can connect (see archive/PROJECT.md, Rust/Python integration).
The thin operating-system layer under crate::agent, like crate::process: exercised
by the integration tests (tests/runner.rs); the decisions around it are unit-tested in
crate::attempt, crate::parse and crate::supervise.
Structs§
- Process
Parse Runner - Starts runners in parse mode for one root (see
crate::parse::parse_files). - Process
Parse Session - A parse runner that connected and got its request.
- Python
Task - A Python task to run: the runner’s request, and the attempt’s secrets (it may read one under a declared prefix while it runs).
- Runner
- A runner that connected and said hello.
Enums§
- Launch
Error - Why a process couldn’t be started or talked to.
- Task
Process - A task’s runner process: spawned, or forked from a fork server.
Constants§
- AGENT_
VERSION - The version runners must have (the same
schedrpackage as the agent). - FD_ENV
- The environment variable with the runner’s descriptor of its socket to the agent.
- OUTPUT_
DRAIN_ TIMEOUT - How long a stopped runner’s output may take to reach its log. A process it started in a session of its own outlives the kill and can hold the pipes open; the log is then left as it is rather than waiting forever.
- RUNNER_
START_ TIMEOUT - How long a started runner has to say hello, unless
[worker] runner_start_timeoutsays.
Functions§
- run_
command - Runs a command process under supervision, keeping the tails of its output;
spawnedgets its process ID as soon as it runs. Withctx, the process (and every process it starts) gets a context channel (SCHEDR_CTX_FD, seecrate::ctx), served until it ends. - run_
python - Runs a Python task: starts the runner (forked by
forkswhen there are any and they can, unless the task asks for a fresh process; only by the bare server withpreloadoff), sends the request, and waits for its result while supervising the process;spawnedgets the runner’s process ID, and whether it was forked, as soon as it runs. A forked process’sGroupHoldgoes tohold, on every path (the caller drops it after its watchdog). - start_
runner - Starts the runner described by
specinmode, handing it its end of a new socket pair, and completes the handshake;spawnedgets its process ID as soon as it runs.