Glossary¶
The names used across the documentation, the API and the logs.
- DAG
A set of tasks and the edges between them, defined in a Python file. Identified by its DAG ID. A DAG has versions: each parse that changes it stores a new one.
- DAG root
One directory of DAG files (an entry of
SCHEDR_DAG_PATH), named after its last path component unless renamed. A DAG file is referenced as root and relative path, e.g.etl:team_a/sync.py, so references are the same on every worker.- Cleanup
Work run after a task attempt on the same worker, before its slot is released and before downstream tasks or a retry proceed. See Cleaning up after a task.
- Connection
A named set of values for a task to connect to a database, API or host. A task declares which it uses. See Connections.
- Connection type
A built-in connection for a kind of server, with a fixed set of values and a Python client, or
Genericfor values of one’s own. See Built-in types.- Content hash
A hash of a root’s scanned files (paths and contents). The scan skips
.git,__pycache__,*.pycand files excluded by.schedrignore. For a DAG root, the hash also includes the hashes of other DAG roots and any used script roots. The master uses it to match tasks to workers with the right code.- Trigger (event trigger)
A watcher belonging to a DAG that finds events and starts runs for new keys. See Event triggers. A DAG can also use
RunOfto start runs after another DAG succeeds, orEventNamedfor events posted by outside systems. A@trigger(wait_for=...)inspects each matching run or named event in a call before deciding whether to start a run.- Event
A trigger’s finding, or a successful run found by
RunOf, identified by a key within its DAG, or an event posted by an outside system, with data and a time. A new key starts an event run.- Bookmark
The last event key a trigger acted on, passed back as
afterwhen it starts again.- Parse job
The master’s request to one worker to parse a root at one content hash and return the DAGs as data (DAG JSON). It imports scanned
.pyfiles that mentionschedr. The master never imports DAG files itself. See Parsing and code versions.- Run (DAG run)
One execution of a DAG, for one moment (
planned_for). Its kind says who created it (scheduled,manual, …). States:queued(waiting formax_active_runs),running, thensuccess,failedorcancelled. Scheduled runs start inrunning. A yellow success still has statesuccess, but asks for attention after a late cleanup failure. A run holds its place until its resource cleanups end; a failed cleanup fails the run. Cancelling a run keeps those cleanups. Cancelling a cleanup task directly stops it.- Task instance
One task of one run. States:
scheduled,queued,unschedulable,running,cleaning_up(its process ended and its cleanup runs; it still holds the slot),up_for_retry,success,failed,cancelled,skipped,upstream_failed. Anunschedulableresource user has not ended, so its resource cleanup must still wait. On success a task has an outcome.- Wait step
A step that waits for a value or times out. A sensor runs on a watcher;
wait_for(RunOf(...))waits for another DAG’s run or task, andwait_for(EventNamed(...))waits for a posted event. Both are ended by the master. An@sensor(wait_for=...)waits there for a matching run or named event, then receives it in a watcher call.- Outcome
Which kind of success a finished task had. A name (
SUCCESS,Rows,CHANGED). Stored with the attempt’s output. Shown on the run graph when it is something other thanSUCCESS. Routing by outcome.- Selection edge
An edge from a
@branchtask to one of its direct downstream tasks. Taken when the branch chose that target; otherwise it counts as skipped, like any edge not taken.- first_of and at_least
Nodes the master ends when one, or a given number, of their options have succeeded. They pass the chosen values on and can also give their task IDs. See Acting on the first of several.
- run_if (trigger rule)
The rule for deciding whether a task’s incoming edges let it run.
RunIf.NONE_FAILED(the default) runs when every edge that wasn’t skipped succeeded and at least one did. It skips the task when all edges were skipped, and marks itupstream_failedas soon as one failed. A task with no incoming edges is ready.RunIf.ALL_SUCCEEDEDrequires every edge to succeed; a failure takes precedence over a skip, so a skip is decided only once no edge can still fail. The master.- Attempt (try)
One try of a task instance on one worker, with its own ID. Its try number counts every attempt; the retry budget counts only the attempts that used a retry. How it ended is its status:
success,failed,timed_out,oom_killed,cancelled,interrupted,lostorassignment_expired.start_method(spawnorfork) is set when the worker’sStartedis stored, and the attempts API shows it. A forked Python task isfork: the worker sends a secondStarted, and the start time stays the first one’s. A spawned process isspawn. Once the result is stored, the attempts API also showsusageandcore_dumped(see Workers).- Context channel
The Unix datagram socket one command attempt inherits (
SCHEDR_CTX_FD). The command’s processes each open a connection of their own and read the run’s parameters and run information over it, until the attempt ends. See Workers and Reading the run from a command.- Fork server
A runner started as
python -m schedr.runner fork_server. It imports libraries once and then starts a process per request. That process runstaskorparseas a spawned runner does, with its own channel, log and process group. On Linux, a worker whose DAG interpreter hasfork_server = truestarts one or two when the worker starts, and forks Python tasks and parse jobs from them. A Python task can ask for the bare server only, or for a new process every time. A command stays a new process. See Workers.- Shim
The process a fork server puts between itself and one forked process. It reports the process ID once that process’s group exists, then the exit and what the process used, and it holds the exited process until the status socket closes, so the ID is not reused. It is not in the process’s group. See Workers.
- Command
A request to change something (trigger a run, cancel a run or task, retry a task, pause or unpause a DAG, drain or resume a worker), stored in the database by the webserver. The master applies it, then marks it
applied(with what it produced) orrejected(with the reason). The CLI waits for that decision.- Round (tick)
One pass of the master’s scheduling loop: commands, the scheduler, dispatching, parse-job timeouts, lost workers. It starts with one statement, the probe, and skips each read the probe found nothing for. The scheduler visits the DAGs due that round. See The master.
- Busy DAG
A DAG a round visits: its stored next fire time has come or isn’t known, it has a run queued, or a command, an ended run or a new version marked it. See The master.
- Quiet DAG
A DAG a round skips: nothing due. The database says which (the stored next fire times and the queued runs), so a standby taking over decides the same way; the first round of a term visits every DAG. See The master.
- Worker ID and incarnation
The worker ID is stable across restarts (by default the host name, which is the pod name in Kubernetes). The incarnation ID is new each time the agent process starts. It tells the master whether a worker reconnected (tasks still running) or restarted (its tasks are gone: those its journal doesn’t report end
lostonce the old incarnation’s lease is over).- Lease
How long a worker may stay silent (the worker lease, 60 s, counted from when its latest message arrived, or after a restart from the master’s start plus the time a master it replaced may still answer, 20 s by default) before the master declares it
lostand ends its attempts. Heartbeats renew it.- Journal
A file per attempt on the worker’s disk, holding attempts that are running and results the master hasn’t acknowledged yet. It lets a restarted agent report results it already had, and stop the processes its previous incarnation left behind.
- Slot
Room for one task on a worker (
[worker] slots, 2). The master never assigns a worker more tasks than it has slots. Parsing has its own slot.- Queue
A name that routes tasks to a group of workers. A task names one (
defaultunless set), and a worker serves the queues in[worker] queues(defaultwhen none are set).- Drain
A worker taking no new work. On SIGTERM it lets running tasks finish within the grace period, then stops;
schedr workers drainkeeps it running and idle until resumed.- Current code
For each root, the content hash of its current parse. Workers with that code, or newer code whose parse is pending, can receive the root’s tasks. See Parsing and code versions.
- Deployment
One schedr the web UI shows: a master, workers, a webserver and a database.
schedr uiis given a list of them ([[ui.deployments]]: a name and the webserver’s URL). Standalone is one, nameddefault. See The web UI.