Skip to main content

Module launch

Module launch 

Source
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§

ProcessParseRunner
Starts runners in parse mode for one root (see crate::parse::parse_files).
ProcessParseSession
A parse runner that connected and got its request.
PythonTask
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§

LaunchError
Why a process couldn’t be started or talked to.
TaskProcess
A task’s runner process: spawned, or forked from a fork server.

Constants§

AGENT_VERSION
The version runners must have (the same schedr package 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_timeout says.

Functions§

run_command
Runs a command process under supervision, keeping the tails of its output; spawned gets its process ID as soon as it runs. With ctx, the process (and every process it starts) gets a context channel (SCHEDR_CTX_FD, see crate::ctx), served until it ends.
run_python
Runs a Python task: starts the runner (forked by forks when there are any and they can, unless the task asks for a fresh process; only by the bare server with preload off), sends the request, and waits for its result while supervising the process; spawned gets the runner’s process ID, and whether it was forked, as soon as it runs. A forked process’s GroupHold goes to hold, on every path (the caller drops it after its watchdog).
start_runner
Starts the runner described by spec in mode, handing it its end of a new socket pair, and completes the handshake; spawned gets its process ID as soon as it runs.