Skip to content

Grow and jitter consecutive throttle waits in the retrier - #2939

Merged
amankrx merged 10 commits into
TraceMachina:mainfrom
amankrx:fix/throttle-wait-growth
Oct 16, 2026
Merged

amankrx merged 10 commits into
TraceMachina:mainfrom
amankrx:fix/throttle-wait-growth

Conversation

@amankrx

@amankrx amankrx commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

What and why

A throttled response (RetryResult::RetryAfter) inside the throttle budget sleeps exactly what the store asked, with no growth and no jitter. Azure sends no Retry-After on an egress throttle, so every process behind one account sleeps the floor and retries in lockstep until the budget is gone. Retrier::with_throttle_max_wait makes the n-th consecutive throttle wait the ask times 2^(n-1), capped, jittered with the store's retry.jitter, never below the ask, and a plain retry ends the streak. The Azure store passes throttle_retry_max_delay_s as the cap. Other stores are unchanged.

How was this verified?

Four new tests in retry_test.rs with a recording sleep: waits double up to the cap (2, 4, 8, 16, 30, 30). Existing throttle tests pass unchanged, so the default path did not move. Not yet run against a throttling account.

Risk

Low. Only a retrier with a cap set changes, and only the Azure store sets one. The first wait is as before; later waits are longer, bounded by the existing cap. No config or wire change.

AI assistance

An agent drafted the change and I reviewed every line.

@vercel

vercel Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
nativelink Ready Ready Preview Oct 16, 2026 2:22pm UTC
nativelink-aidm Ready Ready Preview Oct 16, 2026 2:22pm UTC

Request Review

Comment thread nativelink-util/src/retry.rs
@corcillo

Copy link
Copy Markdown
Collaborator

@amankrx im not sure if per-request throttling is the right approach here, we should probably figure out some high level account wide backoff?

Comment thread nativelink-util/src/retry.rs Outdated
Comment thread nativelink-util/src/retry.rs Outdated
@amankrx

amankrx commented Oct 16, 2026

Copy link
Copy Markdown
Member Author

@amankrx im not sure if per-request throttling is the right approach here, we should probably figure out some high level account wide backoff?

We can add that separately. This should be helpful.

@amankrx
amankrx merged commit 23e76a8 into TraceMachina:main Oct 16, 2026
38 checks passed

This branch was successfully deployed

2 active deployments
Preview – nativelink — f885708d Deployed Oct 16, 2026 by vercel[bot]
Preview – nativelink-aidm — f885708d Deployed Oct 16, 2026 by vercel[bot]
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.

3 participants