quak backup retries failed requests for longer (closes #165) #174

Merged
clawbot merged 1 commits from issue-165-backup-retry-budget into next 2026-10-06 12:47:41 +02:00
Collaborator

Implements #165, part of #162.

quak backup usually runs from cron with nobody watching. With the default budget (4 attempts, at most about 3.5 s of waiting), an outage longer than a few seconds fails files until the next run.

  • src/retry.ts exports UNATTENDED_RETRY_OPTIONS beside the unchanged DEFAULT_RETRY_OPTIONS: 10 attempts, 1 s base delay, 60 s cap. A request that keeps failing waits at most 243 s before it gives up. It is exported from the library for use as ApiClientOptions.retry.
  • bin/quak.ts loads the backup's session with it. Every request the backup makes goes through that client, so the refresh, the ML data and the downloads all use it. Every other command keeps the default. src/cli-commands.ts is untouched.
  • README "Retries and timeouts": one table with both budgets, and the backup's worst-case wait. TODO.md: Completed Steps entry.

Not visible in the diff:

  • The 243 s is the waiting between attempts. Each attempt can also run until its own deadline (30 s for a request, 60 s without bytes for a download).
  • The ML data request is a POST. It is still repeated only when no connection was ever made: the budget changes how many attempts are made, not what is retried.
  • test/cli/bin.test.ts runs bin/quak.ts with the session loader swapped for a module mock that records the options and reports no session. test/client/session.test.ts checks that the loader gives those options to the client.

Model: opus-5-5

Implements https://git.eeqj.de/sneak/quak/issues/165, part of https://git.eeqj.de/sneak/quak/issues/162. `quak backup` usually runs from cron with nobody watching. With the default budget (4 attempts, at most about 3.5 s of waiting), an outage longer than a few seconds fails files until the next run. - `src/retry.ts` exports `UNATTENDED_RETRY_OPTIONS` beside the unchanged `DEFAULT_RETRY_OPTIONS`: 10 attempts, 1 s base delay, 60 s cap. A request that keeps failing waits at most 243 s before it gives up. It is exported from the library for use as `ApiClientOptions.retry`. - `bin/quak.ts` loads the backup's session with it. Every request the backup makes goes through that client, so the refresh, the ML data and the downloads all use it. Every other command keeps the default. `src/cli-commands.ts` is untouched. - README "Retries and timeouts": one table with both budgets, and the backup's worst-case wait. `TODO.md`: Completed Steps entry. Not visible in the diff: - The 243 s is the waiting between attempts. Each attempt can also run until its own deadline (30 s for a request, 60 s without bytes for a download). - The ML data request is a `POST`. It is still repeated only when no connection was ever made: the budget changes how many attempts are made, not what is retried. - `test/cli/bin.test.ts` runs `bin/quak.ts` with the session loader swapped for a module mock that records the options and reports no session. `test/client/session.test.ts` checks that the loader gives those options to the client. Model: opus-5-5
clawbot added the needs-review label 2026-10-06 01:59:54 +02:00
clawbot self-assigned this 2026-10-06 01:59:55 +02:00
Author
Collaborator
  • README.md line 435 ("so an outage of a few minutes does not fail files until the next run") and the comment above UNATTENDED_RETRY_OPTIONS in src/retry.ts line 41 ("it rides out an outage of a few minutes") are not true of the code. Each wait is drawn at random below its ceiling, so 243 s is the rare upper end: a request whose attempts fail at once (a 503, a refused connection) gives up after about two minutes of waiting on average, so a two-minute outage still fails about half of those requests and a three-minute one nearly all. Acceptable: state what the budget gives (at most 243 s of waiting, usually about half that) and drop the claim that an outage of a few minutes no longer fails files.

Model: opus-5-5

- `README.md` line 435 ("so an outage of a few minutes does not fail files until the next run") and the comment above `UNATTENDED_RETRY_OPTIONS` in `src/retry.ts` line 41 ("it rides out an outage of a few minutes") are not true of the code. Each wait is drawn at random below its ceiling, so 243 s is the rare upper end: a request whose attempts fail at once (a 503, a refused connection) gives up after about two minutes of waiting on average, so a two-minute outage still fails about half of those requests and a three-minute one nearly all. Acceptable: state what the budget gives (at most 243 s of waiting, usually about half that) and drop the claim that an outage of a few minutes no longer fails files. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-06 02:28:07 +02:00
clawbot force-pushed issue-165-backup-retry-budget from f66d10ff76 to 22682fa7cf 2026-10-06 03:25:54 +02:00 Compare
clawbot changed title from quak backup retries failed requests for longer to quak backup retries failed requests for longer (closes #165) 2026-10-06 03:26:03 +02:00
clawbot added needs-review and removed needs-rework labels 2026-10-06 03:26:04 +02:00
Author
Collaborator

README "Retries and timeouts" and the comment above UNATTENDED_RETRY_OPTIONS in src/retry.ts now say a request that keeps failing waits at most 243 s, usually about half that because each wait is drawn at random below its ceiling. The claim that an outage of a few minutes no longer fails files is gone.

Model: opus-5-5

README "Retries and timeouts" and the comment above `UNATTENDED_RETRY_OPTIONS` in `src/retry.ts` now say a request that keeps failing waits at most 243 s, usually about half that because each wait is drawn at random below its ceiling. The claim that an outage of a few minutes no longer fails files is gone. Model: opus-5-5
Author
Collaborator
  • README.md "Retries and timeouts", the sentence after the table: "every request it makes uses the second column instead". The table's columns are Option, Default, quak backup, Meaning, so the second column is Default, and read as written the sentence says the backup uses the default numbers. Acceptable: name the column, for example "uses the quak backup column instead".

Model: opus-5-5

- `README.md` "Retries and timeouts", the sentence after the table: "every request it makes uses the second column instead". The table's columns are Option, Default, `quak backup`, Meaning, so the second column is Default, and read as written the sentence says the backup uses the default numbers. Acceptable: name the column, for example "uses the `quak backup` column instead". Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-06 04:43:44 +02:00
clawbot force-pushed issue-165-backup-retry-budget from 22682fa7cf to 334de784ff 2026-10-06 05:29:18 +02:00 Compare
clawbot force-pushed issue-165-backup-retry-budget from 334de784ff to ac64449b40 2026-10-06 06:29:25 +02:00 Compare
clawbot added needs-review and removed needs-rework labels 2026-10-06 06:29:32 +02:00
Author
Collaborator
  • README "Retries and timeouts": the sentence after the table now says the backup uses the quak backup column.
  • Rebased onto next. The TODO.md entry now sits above the one for #163.

Model: opus-5-5

- README "Retries and timeouts": the sentence after the table now says the backup uses the `quak backup` column. - Rebased onto `next`. The `TODO.md` entry now sits above the one for https://git.eeqj.de/sneak/quak/issues/163. Model: opus-5-5
Author
Collaborator
  • Needs rebase onto current next: TODO.md conflicts with the Completed Steps entry for #166, which landed on next after this branch was last rebased. Acceptable: the branch rebased onto current next, with this change's entry at the top of Completed Steps above that one and dated no earlier than it.

Model: opus-5-5

- Needs rebase onto current `next`: `TODO.md` conflicts with the Completed Steps entry for https://git.eeqj.de/sneak/quak/issues/166, which landed on `next` after this branch was last rebased. Acceptable: the branch rebased onto current `next`, with this change's entry at the top of Completed Steps above that one and dated no earlier than it. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-06 07:17:53 +02:00
clawbot added 1 commit 2026-10-06 11:14:25 +02:00
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
clawbot force-pushed issue-165-backup-retry-budget from ac64449b40 to e879475e8d 2026-10-06 11:14:25 +02:00 Compare
clawbot added needs-review and removed needs-rework labels 2026-10-06 11:14:30 +02:00
Author
Collaborator

Rebased onto current next. The TODO.md entry now sits at the top of Completed Steps, above the one for #171, dated 2026-10-06.

Model: opus-5-5

Rebased onto current `next`. The `TODO.md` entry now sits at the top of Completed Steps, above the one for https://git.eeqj.de/sneak/quak/issues/171, dated 2026-10-06. Model: opus-5-5
Author
Collaborator

Review passed.

Model: opus-5-5

Review passed. Model: opus-5-5
clawbot merged commit ad0e11407f into next 2026-10-06 12:47:41 +02:00
clawbot deleted branch issue-165-backup-retry-budget 2026-10-06 12:47:41 +02:00
Sign in to join this conversation.