quak backup retries failed requests for longer (closes #165)
check / check (push) Successful in 4m16s
check / check (push) Successful in 4m16s
src/retry.ts exports UNATTENDED_RETRY_OPTIONS beside the unchanged default: 10 attempts, a 1 s base delay and a 60 s cap, so a request that keeps failing waits at most 243 s before it gives up. bin/quak.ts loads the backup's session with them, so its refresh, ML data and downloads all use them; every other command keeps the default. What is retried and the backoff formula are unchanged. Model: opus-5-5
This commit was merged in pull request #174.
This commit is contained in:
@@ -415,18 +415,24 @@ Backoff is exponential with full jitter: the delay before retry _n_ is
|
||||
`random() * min(maxDelayMs, baseDelayMs * 2 ** (n - 1))`. The exponential term
|
||||
is the ceiling and the wait is drawn below it, so a client that lost many
|
||||
parallel downloads to one CDN blip does not send them all again at the same
|
||||
instant. Defaults, configurable through `ApiClientOptions.retry`:
|
||||
instant. The numbers, configurable through `ApiClientOptions.retry`:
|
||||
|
||||
| Option | Default | Meaning |
|
||||
| ------------- | ------- | ----------------------------------- |
|
||||
| `attempts` | `4` | total calls, not retries |
|
||||
| `baseDelayMs` | `500` | ceiling for the first retry's delay |
|
||||
| `maxDelayMs` | `10000` | upper bound on that ceiling |
|
||||
| Option | Default | `quak backup` | Meaning |
|
||||
| ------------- | ------- | ------------- | ----------------------------------- |
|
||||
| `attempts` | `4` | `10` | total calls, not retries |
|
||||
| `baseDelayMs` | `500` | `1000` | ceiling for the first retry's delay |
|
||||
| `maxDelayMs` | `10000` | `60000` | upper bound on that ceiling |
|
||||
|
||||
With those defaults a file that is going to fail gives up after at most three
|
||||
and a half seconds of waiting. `sleep` and `random` are injectable through the
|
||||
same option, which is how the test suite exercises the whole policy without
|
||||
waiting.
|
||||
With the defaults a file that is going to fail gives up after at most three and
|
||||
a half seconds of waiting. `quak backup` usually runs from cron with nobody
|
||||
watching, so every request it makes uses the `quak backup` column instead,
|
||||
exported as `UNATTENDED_RETRY_OPTIONS`: a request that keeps failing gives up
|
||||
after at most 243 seconds of waiting, and usually after about half that, since
|
||||
each wait is drawn at random below its ceiling. Every other command uses the
|
||||
defaults. A library user gets the same budget by passing
|
||||
`UNATTENDED_RETRY_OPTIONS` as `ApiClientOptions.retry`. `sleep` and `random` are
|
||||
injectable through the same option, which is how the test suite exercises the
|
||||
whole policy without waiting.
|
||||
|
||||
Two deadlines, renewed for each attempt:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user