Skip to content

fix(traces): fix rate limit backoff in ExternalFetcher#13604

Open
gutonosa wants to merge 1 commit intofoundry-rs:masterfrom
gutonosa:external-fetcher-backoff
Open

fix(traces): fix rate limit backoff in ExternalFetcher#13604
gutonosa wants to merge 1 commit intofoundry-rs:masterfrom
gutonosa:external-fetcher-backoff

Conversation

@gutonosa
Copy link
Copy Markdown
Contributor

@gutonosa gutonosa commented Mar 3, 2026

Rate limit backoff in ExternalFetcher never actually waits.

tokio::time::interval() fires its first tick immediately, so after a 429 the loop just takes the interval out, sees Ready, drops it, and retries with no delay. Cycle repeats on every rate limit hit.

What happens:

  1. 429 → sets backoff = Some(interval(5s))
  2. Next loop: .take() pulls it out, poll_tick() → instant Ready, if-let falls through, interval dropped
  3. queue_next_reqs() fires immediately → another 429 → repeat

Fix: interval_at(now + timeout, timeout) so the first tick respects the delay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant