Skip to main content

Module scheduler

Module scheduler 

Source
Expand description

The scheduler pass: new scheduled runs, queued runs started, and manual runs.

Each pass looks at the DAGs that can run (not removed, not in conflict, with a version) that it visits: an unpaused DAG gets runs for its due fire times (Plan::scheduled_runs), then queued runs take the places left (runs_to_start). Pausing stops only the first part. Runs are stored before anything else happens to them, and a scheduled run is unique per planned_for, so a pass repeated after a crash creates nothing twice.

Which DAGs a pass looks at is QuietDags’s choice (decision 485): every DAG, or those the database finds due (a scheduled DAG’s stored next fire time come or unknown, a queued run) and those marked. After each visit a scheduled DAG’s next fire time is stored when it changed: the visit’s own time while due runs wait (held, at max_active_runs, past the round’s share), else its next fire time, NO_FIRE when it has none.

Modules§

backfill
Creating a backfill (decisions 363, 364, 400-404; see archive/PROJECT.md, Runs: manual runs, backfill and pausing): one backfill run per fire time of the range with no successful, queued or running run (every one with --all), each for one schedule period, all created at once with the backfill, queued oldest first behind the other kinds. A paused DAG’s backfill runs start too (decision 401).

Structs§

CreatedRun
A run created by the scheduler or a person.
Pass
What a pass did.
Scheduler
The scheduler over a database (cheap to clone; clones share which DAGs are quiet).

Enums§

SchedulerError
Why a scheduler operation failed.

Constants§

SCHEDULED_PER_ROUND
The most scheduled runs a round creates for one DAG: a DAG catching up after a long pause goes over a few rounds, the earliest first (B18).
SCHEDULER
Who created scheduled runs, as recorded in triggered_by.