Docs / Using Maple
Retries
Jobs fail: networks drop, services restart, bugs happen. Maple retries every failed job until it succeeds or runs out of attempts.
Backoff
The wait before a retry doubles with every attempt, starting at retry.backoff, and a random jitter of up to 20% keeps retries of many jobs from arriving at once. With the defaults, a job is tried for about three days before it is given up.
| Attempt | Wait before it |
|---|---|
| 2 | 10 seconds |
| 3 | 20 seconds |
| 5 | 1 minute 20 seconds |
| 10 | about 43 minutes |
| 25 | about 3 days in total |
Failed jobs
A job that used up its attempts is marked failed and stays in the table with the error of its last attempt. List and retry them with:
$ maple jobs --state failed
$ maple retry --all-failed
Make your jobs safe to run twice. A worker that crashes in the middle of a job cannot tell whether its work got done, so the job will run again.