Skip to main content

settle

Function settle 

Source
pub fn settle(
    task: &mut Task,
    verdict: Verdict,
    detail: &str,
    max_attempts: usize,
)
Expand description

Record a finished run against the task it came from.

Kept pure and separate from the loop because this mapping is the retry policy, and a policy that can only be exercised by spawning a graph is a policy nobody checks. The table:

run statustask becomesattempt spent
parked at a boundaryFailed (requeued)no
Merged, ReadyDoneyes
Stalled, quota hitFailed (requeued)no
Stalled, no quotaFailed, or Heldyes
Blocked with a PRHeldyes
Blocked, FailedFailed, or Heldyes
anything non-terminalFailed, or Heldyes

The two Stalled rows are the ones worth reading twice. A quorum lost to rate limits is a property of the machine and not of the task, so the attempt is refunded and a reset quota picks the work up where it stopped. A quorum lost to judges that answered with the wrong shape is ordinary flakiness, and refunding that takes the bound off the retry loop entirely: run e633 stalled with quota: [] after two judges wrote unusable JSON, was refunded, and the next attempt paid for a fresh hour-long implement wave before it could fail the same way. max_attempts exists precisely so that cannot repeat forever.

A non-terminal status means execute returned while the graph was still mid-flight, which is a bug rather than a verdict; it is treated as a failure so that a task cannot loop on it either.

left_pr splits the Blocked row, and it is the difference between a run that failed and a run that finished into a gate. See Task::handed_off.