Skip to content

fix(toolbox): retry op run and the toolbox action downloads - #26

Merged
jshvn merged 1 commit into
mainfrom
josh/setup-retry
Oct 16, 2026
Merged

jshvn merged 1 commit into
mainfrom
josh/setup-retry

Conversation

@jshvn

@jshvn jshvn commented Oct 16, 2026

Copy link
Copy Markdown
Member

ctan run 38917887841 (2026-10-16 14:42 UTC) failed one second into task sync with [ERROR] (502) Unknown from op run --env-file=op.env. 1Password blipped, and CTAN was never contacted. op run and the toolbox action's two curl downloads are the single-shot setup calls that every mirror makes on every run. Everything after them (rsync, aws, curl in the engine, the pings) already retries.

  • op verb (toolbox.yml): up to five tries, with waits of 5, 10, 20 and 40 s (75 s at most). It retries only when op failed before the command started. The child first touches a mktemp -u marker. If the marker exists, op started the command, its exit code stands, and the pipeline is never started twice. This covers sync, plan, the "cut off" fallback step, session-seal and empty-trash.
  • Toolbox action: the go-task and op downloads use curl --retry 4 --retry-all-errors: five tries, waits of 1, 2, 4 and 8 s (curl's own doubling). Checked against a closed port: 5 attempts, 15 s.
  • .github/op-retry-check.sh: puts a stub op and a stub sleep first in PATH, and uses a test Taskfile that includes toolbox.yml and runs run on the host. It needs no image and no vault. It runs in ci.yml and is listed in CLAUDE.md.
  • README: the op row, the "reads the vault one time" bullet and the toolbox action paragraph mention the retry.

Not covered: when op fails all five tries, the run still sends no /fail ping, because HEALTHCHECK_URL itself comes from 1Password. The healthcheck grace still catches it.

Rollout

  • The op change reaches every mirror when v2 moves (remote include).
  • The action change reaches a mirror only when its uses: pin moves to the new release, so each consumer gets a pin-bump PR after the tag.
  • pipeline is unchanged, so no consumer's render.txt moves.

Test plan

  • sh .github/op-retry-check.sh fails on main (fail 1 for the two retry cases) and passes on this branch
  • shellcheck clean; validate-vars.sh --check and chain-file.sh --check pass
  • task --list parses in examples/rsync and examples/proton
  • CI green, including the new step on ubuntu (dash as /bin/sh)

ctan run 38917887841 (2026-10-16 14:42 UTC) failed one second in: op run
got a 502 from 1Password before the pipeline started. op was the one
setup call with no retry, so one blip cost the hourly slot. The failure
path runs inside op run, so the run also sent no /fail ping.

- toolbox.yml op: up to five tries, waits 5, 10, 20, 40 s. The command
  first touches a marker file; once it exists, op started the command,
  so its exit stands and the pipeline is never started twice.
- toolbox action: the go-task and op downloads use curl --retry 4
  --retry-all-errors (five tries, waits 1, 2, 4, 8 s).
- .github/op-retry-check.sh: stub op and sleep on PATH, run on the
  host. Three cases: op fails twice then starts, the command fails
  (no retry), op always fails (five tries). Runs in ci.yml.
@jshvn
jshvn merged commit e18ef7d into main Oct 16, 2026
2 checks passed
@jshvn
jshvn deleted the josh/setup-retry branch October 16, 2026 15:16
jshvn added a commit to katoptra/ctan that referenced this pull request Oct 16, 2026
Moves both `uses:` pins of katoptra/lib to `e18ef7d` (v2.6.1,
katoptra/lib#26).

- **Toolbox action** (comes with this pin): the go-task and `op`
downloads try five times, with waits of 1, 2, 4 and 8 s.
- **`op` verb** (comes with the `v2` include, so it already applies
after the release, with or without this PR): when `op run` fails before
the pipeline starts, as with the 1Password 502 in ctan run 38917887841,
it tries five times, with waits of 5, 10, 20 and 40 s. Once the pipeline
has started, it never starts it again.

`pipeline` is unchanged, so `render.txt` does not move.

## Test plan
- [ ] `check` green on this PR (it runs the new toolbox action)
- [ ] The next scheduled sync after merge is green
jshvn added a commit to katoptra/gnu that referenced this pull request Oct 16, 2026
Moves both `uses:` pins of katoptra/lib to `e18ef7d` (v2.6.1,
katoptra/lib#26).

- **Toolbox action** (comes with this pin): the go-task and `op`
downloads try five times, with waits of 1, 2, 4 and 8 s.
- **`op` verb** (comes with the `v2` include, so it already applies
after the release, with or without this PR): when `op run` fails before
the pipeline starts, as with the 1Password 502 in ctan run 38917887841,
it tries five times, with waits of 5, 10, 20 and 40 s. Once the pipeline
has started, it never starts it again.

`pipeline` is unchanged, so `render.txt` does not move.

## Test plan
- [ ] `check` green on this PR (it runs the new toolbox action)
- [ ] The next scheduled sync after merge is green
jshvn added a commit to katoptra/gnu-alpha that referenced this pull request Oct 16, 2026
Moves both `uses:` pins of katoptra/lib to `e18ef7d` (v2.6.1,
katoptra/lib#26).

- **Toolbox action** (comes with this pin): the go-task and `op`
downloads try five times, with waits of 1, 2, 4 and 8 s.
- **`op` verb** (comes with the `v2` include, so it already applies
after the release, with or without this PR): when `op run` fails before
the pipeline starts, as with the 1Password 502 in ctan run 38917887841,
it tries five times, with waits of 5, 10, 20 and 40 s. Once the pipeline
has started, it never starts it again.

`pipeline` is unchanged, so `render.txt` does not move.

## Test plan
- [ ] `check` green on this PR (it runs the new toolbox action)
- [ ] The next scheduled sync after merge is green
jshvn added a commit to katoptra/nongnu that referenced this pull request Oct 16, 2026
Moves both `uses:` pins of katoptra/lib to `e18ef7d` (v2.6.1,
katoptra/lib#26).

- **Toolbox action** (comes with this pin): the go-task and `op`
downloads try five times, with waits of 1, 2, 4 and 8 s.
- **`op` verb** (comes with the `v2` include, so it already applies
after the release, with or without this PR): when `op run` fails before
the pipeline starts, as with the 1Password 502 in ctan run 38917887841,
it tries five times, with waits of 5, 10, 20 and 40 s. Once the pipeline
has started, it never starts it again.

`pipeline` is unchanged, so `render.txt` does not move.

## Test plan
- [ ] `check` green on this PR (it runs the new toolbox action)
- [ ] The next scheduled sync after merge is green
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant