Expand description
How a run’s tasks move forward: readiness (NoneFailed), retries, cancelling and the run
result (see archive/PROJECT.md, Outcomes, failures and joins, and Task assignment).
Pure rules over task instance states; crate::execution stores what they decide.
- Trigger rules count edges: an edge counts as its upstream task’s state, except one
whose upstream succeeded with an outcome the edge isn’t taken on (
.on(...)), which counts as skipped. NoneFailed(the default): a task is ready when every edge that wasn’t skipped succeeded and at least one did (or it has none); skipped when all its edges were skipped; upstream failed as soon as one failed.AllSucceeded: ready when every edge succeeded; upstream failed as soon as one failed; otherwise skipped when one was skipped, once none can fail any more.- An attempt that failed uses a retry; with retries left the task waits
retry_delay(up_for_retry), otherwise it fails. Failures certain to repeat are never retried. An attempt interrupted by draining or never started runs again without using a retry. - A run is
failedif a task failed after its last retry, elsecancelledif a user cancelled it (and something was cancelled), elsesuccess; decided once every task (and every instance of a mapped one) has finished. - A mapped task (decisions 70, 74, 75): its
-1state is the task as a whole. Once its upstream allows (a lane counting as ready once its upstream has expanded) it is expanded: its instances are created (or it fails, or succeeds with none), and it isrunning. Each instance waits for the whole-task edges and for its lanes’ instances; an instance whose lane isn’t taken is skipped. An instance that fails (or whose lane failed) fails the step at once: the others are cancelled, running ones stopped. Once every instance has finished, the task applies its ownrun_ifto them as to edges.
Structs§
- Changes
- What changed since a
Snapshot: (task,map_index, new state). - Instances
- The instances of a mapped task that expanded.
- RunProgress
- A run’s task states, moved forward by the DAG’s structure.
- Snapshot
- The states of a run’s tasks and instances at one moment, to tell what changed since.
Enums§
- After
Attempt - What happens to a task after one of its attempts ended.
- Expansion
- How a mapped task expands, as the master resolved what it is mapped over.
- Readiness
- What a task’s upstream tasks decide for it.
Constants§
- EMPTY_
CLEANUP - The reason an empty cleanup gets, where its log would be (decision 276).
- NOT_
RETRIED_ ERRORS - Error kinds of failures certain to repeat: never retried. A secret that doesn’t exist or
isn’t permitted, and what the same inputs always do again. (
secret_unavailable, a secret storage that is down, andimport_failed/task_not_found, which new code can fix, are retried.) ATriggerDagOperator’s parameters refused, or a target that takes no such run (decisions 379, 398); a missing, held or paused target is retried.
Functions§
- after_
attempt - Decides what follows an attempt with
status(and the error kind schedr recognised, if any), given how many retries the task used before it and whether the task or its run is being cancelled (then nothing runs again, a failure stays a failure, and an attempt lost with its worker is cancelled). - first_
of_ readiness - What the states of a
first_of’s edges decide,needof them having to be taken (decision 347): ready as soon as they are; waiting while they still can be; otherwise what stopped them. - readiness
- The trigger rule
ruleover the states of a task’s edges (an edge not taken counts as skipped). - run_
result - The run’s result once every task has finished;
Nonewhile some task hasn’t.
Type Aliases§
- Instance
Key - A task instance: its task and
map_index(-1: an unmapped task, or a mapped one as a whole).