Skip to content

feat(upload): bound upload attempts with a size-scaled deadline#178

Open
ben-miru wants to merge 8 commits into
mainfrom
feat/upload-attempt-deadline
Open

feat(upload): bound upload attempts with a size-scaled deadline#178
ben-miru wants to merge 8 commits into
mainfrom
feat/upload-attempt-deadline

Conversation

@ben-miru

@ben-miru ben-miru commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Every upload attempt is now wrapped in tokio::time::timeout at the Uploader actor seam (Worker::attempt_upload), with a size-scaled deadline: a 120 s floor plus 1 s per 64 KiB of job size (UploaderOptions::attempt_deadline, saturating arithmetic with div_ceil and a zero-divisor guard).
  • Why: gcs::Store::put carries no timeout by design and documents that callers must enforce a size-scaled deadline — but no caller did, so a silently dead connection during a GCS transfer stalled the uploader round indefinitely and backed up the queue. S3 already had implicit stall protection via AWS SDK defaults; this bounds the whole attempt uniformly for both stores.
  • Deadline expiry surfaces as the new retryable UploadErr::AttemptTimeoutErr and rides the existing backoff/requeue/attempt-cap machinery unchanged.
  • Doc contracts updated (UploadExecutor cancel-safety now covers deadline expiry; the gcs::Store::put deadline paragraph points at the actor's bound) and tests added (attempt_deadline_formula unit tests plus the paused-clock hung_attempt_times_out_and_is_retried acceptance test).
  • ExecPlan recorded and completed at plans/completed/20260717-upload-attempt-deadline.md.

Validation

  • Full suite: 1515 passed, 0 failed; covgate upload at 96.81% against its 96.00 gate.
  • CI green on the branch (lint, test, tools).

🤖 Generated with Claude Code


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

@ben-miru
ben-miru marked this pull request as ready for review July 18, 2026 00:31
ben-miru and others added 8 commits July 20, 2026 14:08
Backlog ExecPlan for bounding each upload attempt with tokio::time::timeout
at the actor seam: floor (120s) plus a per-byte allowance (64 KiB/s minimum
throughput), surfaced as a retryable AttemptTimeoutErr so the existing
backoff/requeue machinery applies.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ben-miru
ben-miru force-pushed the feat/upload-attempt-deadline branch from 197f902 to 136ef3a Compare July 20, 2026 21:09
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