Repository navigation
Turbo now batches writes around R2's per-key write limit and keeps idempotency keys after jobs complete.
Queue behavior
- The broker starts at most one R2 write per queue per second by default. Requests that arrive during the wait join the next batch, and the broker retries transient R2 errors.
- Claim leases start when the broker applies the commit and last at least two commit intervals.
- When the queue reaches its storage cap, the broker evicts the oldest completed jobs first. Pushes that still don't fit return
507 queue_full, and other operations in the batch can commit. - Existing R2 queue files remain readable.
API changes
- A duplicate push for a retained completion returns
200withduplicate: true,jobId, andcompletedAt. The default retention is one hour, and the storage cap can shorten it. Repeating a completion with the same lease token returnsalreadyCompleted: truewhile the completion is retained. - Only claim and heartbeat responses include lease tokens. Queue inspection now includes retained completions.
- Mutations can return
503withRetry-Afterwhen the broker is overloaded or R2 retries are exhausted. Reuse the same idempotency key when retrying a push afterstorage_unavailable, since R2 may have committed it.
GitHub Actions passed lint, type checks, the Wrangler dry run, the test suite, and the TLA+ model check.