Skip to content

CLI 0.2.19: snapshot uploads the store refuses are tried again - #128

Merged
ndbroadbent merged 2 commits into
mainfrom
cli-upload-retry
Dec 3, 2026
Merged

ndbroadbent merged 2 commits into
mainfrom
cli-upload-retry

Conversation

@ndbroadbent

@ndbroadbent ndbroadbent commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

A CI run's upload failed on one 429 from the blob store. It was the journeys job on #126, run 47079339687:

visualci: uploading a snapshot: HTTP status client error (429 Too Many Requests) for url (https://….r2.cloudflarestorage.com/visualci/blobs/…)

The CLI uploads each file to its presigned storage URL, eight at a time, and gave up on the first refusal. R2 limits how fast one client may write. Customers' CI uploading hundreds of screenshots would hit this too.

Change

Client::put_blob sends each storage PUT. It tries again on a 429, a 5xx or a dropped connection (timeout, connect, request), up to six tries in all. It waits as long as Retry-After asks (at most 30 s), otherwise 0.5, 1, 2, 4, then 8 s. Any other refusal (a 403 from an expired URL) fails at once, as before.

CLI 0.2.19: the workspace version, Cargo.lock's visualci-* entries (visualci_server included) and app/Cargo.lock's visualci-core. The docs' VISUALCI_VERSION= lines move in a later commit, once the release is out.

  • At most 8 uploads at once: the limit it already had, now a named constant (UPLOADS). Each batch of up to 500 files is split over 8 threads, and the batches run one after another.
  • --verbose prints each retry: visualci: upload refused (try 2 of 6), trying again in 1.0 s.

Tests

The tests run against a local storage server that answers with a set list of statuses:

  • a_refused_upload_is_tried_again: 429, then 503, then 200, so three PUTs and success.
  • an_upload_refused_six_times_fails: 429 every time, so six PUTs, and the error names the 429.
  • a_bad_request_is_not_tried_again: 403, so one PUT.

fmt, clippy, and both locks pass with cargo metadata --locked.

@ndbroadbent
ndbroadbent merged commit 7498ce7 into main Dec 3, 2026
14 checks passed
@ndbroadbent
ndbroadbent deleted the cli-upload-retry branch December 3, 2026 10:27
ndbroadbent added a commit that referenced this pull request Dec 3, 2026
…the CLI's fingerprint; plugin 0.1.48

cli.md and screenshots.md say the CLI sends images by their SHA-256 and VisualCI fingerprints them; pdfs.md (and its skill) says why PDFs keep their fingerprint: their bytes change every run while what they draw doesn't.
ndbroadbent added a commit that referenced this pull request Dec 3, 2026
…the CLI's fingerprint; plugin 0.1.48

cli.md and screenshots.md say the CLI sends images by their SHA-256 and VisualCI fingerprints them; pdfs.md (and its skill) says why PDFs keep their fingerprint: their bytes change every run while what they draw doesn't.
ndbroadbent added a commit that referenced this pull request Dec 3, 2026
…the CLI's fingerprint; plugin 0.1.48

cli.md and screenshots.md say the CLI sends images by their SHA-256 and VisualCI fingerprints them; pdfs.md (and its skill) says why PDFs keep their fingerprint: their bytes change every run while what they draw doesn't.
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