# Reliability

Fast is easy. Fast and complete is the hard part. Machyon is built so that when a run ends, you know the state of every single row.

Prefer to watch first? [Machyon in 104 seconds](<https://divyanshusingh96.github.io/machyon/project/film/index.md>) follows one real run of 3,000 links through these checks, with a chapter for each.

Opa, the mascot, has five eyes. Machyon checks every row at five points too:

1. **The plan.** Before any request: is the URL usable, is the filename safe and unique, is the file already on disk? Duplicate URLs are fetched once.
2. **The response.** A transient error is retried with backoff; a permanent one (a 404, an unusable URL) is recorded at once instead of wasting retries. [Retries and rate limits](<https://divyanshusingh96.github.io/machyon/reliability/retries-and-rate-limits/index.md>)
3. **The pace.** A 429 pauses new requests to the host that sent it, for as long as it asked; other hosts keep going. Concurrency adapts to what the server and your connection can take. [Adaptive concurrency](<https://divyanshusingh96.github.io/machyon/performance/adaptive-concurrency/index.md>)
4. **The bytes.** The body must start with a real image signature, so an HTML error page is never saved as `photo.jpg`. Large bodies are checked for their full length and resume after a dropped connection. [Image validation](<https://divyanshusingh96.github.io/machyon/reliability/image-validation/index.md>)
5. **The disk.** A file appears only when it is complete, by an atomic rename. A full disk stops the run cleanly instead of producing broken files. [Resuming](<https://divyanshusingh96.github.io/machyon/reliability/resuming/index.md>)

Whatever happens at any of these points ends up in one of three places: a complete file, a skipped row, or a line in the [failure ledger](<https://divyanshusingh96.github.io/machyon/reliability/failure-ledger/index.md>). That is [the zero-lost contract](<https://divyanshusingh96.github.io/machyon/reliability/zero-lost/index.md>).

## In this section

| Page | Answers |
| --- | --- |
| [The zero-lost contract](<https://divyanshusingh96.github.io/machyon/reliability/zero-lost/index.md>) | What exactly is guaranteed, and where the guarantee stops |
| [Retries and rate limits](<https://divyanshusingh96.github.io/machyon/reliability/retries-and-rate-limits/index.md>) | What is retried, how often, how long Machyon waits |
| [Image validation](<https://divyanshusingh96.github.io/machyon/reliability/image-validation/index.md>) | What counts as an image, and what doesn't |
| [Resuming](<https://divyanshusingh96.github.io/machyon/reliability/resuming/index.md>) | What happens when you run the same command again, or after a crash |
| [The failure ledger](<https://divyanshusingh96.github.io/machyon/reliability/failure-ledger/index.md>) | Reading `failed_downloads.jsonl` and acting on it |
