Building flows
Handling failure
Steps fail: an API is down, a fix doesn't pass its tests, an agent runs out of time. Spoletta lets you bound how long a step may take, try it again, and hand a failure to another process instead of failing the run.
When a step fails
An agent, script or Sentry step fails on:
- an error, or a script's non-zero exit;
- a reply that doesn't match its output contract, after it was told what was wrong;
- its timeout;
- a person stopping it.
A failure ends its branch. The rest of the run goes on, but the run ends failed, unless a handler takes the failure.
Timeout and retries
| Setting | Range | Effect |
|---|---|---|
| Timeout (s) | 1 to 86400 | The step fails after this long. Empty uses the worker's. |
| Retries | 0 to 5 | How many more times a failed step is tried. Each try is a step of its own in the run's list. A stopped step isn't retried. |
Failure handlers
Draw the connection
Drag from the process that may fail onto the one that handles it. The connection is red and dashed, on failure. Only agent, script and Sentry processes can have one, and a process can't handle its own failure.
Write the handler
The handler runs in a fresh pass and is given everything the failed process took, plus an extra input named
Failure of Fixholding what went wrong. It needs no links of its own to receive them.Report's prompttext Fixing this exception failed. Comment on the Sentry issue with what was tried and why it failed.Carry on
The failed process's branch ends, but the run goes on and can still end done. The handler can yield what the branch would have, such as an item of Outcomes.
How a run ends
| Status | When |
|---|---|
| Done | Nothing is left to run and no failure went unhandled. |
| Failed | Some branch failed without a handler. |
| Terminated | A step generated a unique value another run already stored; reviews still waiting end undecided. |
| Interrupted | A person stopped the run, or the server restarted mid-run. |
Fix fails after 1800 seconds.
Fix is tried again up to 1 times when it fails.
Report handles a failure of Fix.
To find out why a step failed, see Debugging a run.