Skip to content

fix(stats): retry transient query failures - #50205

Merged
adamdotdevin merged 1 commit into
devfrom
retry-stats-timeouts
Sep 20, 2026
Merged

adamdotdevin merged 1 commit into
devfrom
retry-stats-timeouts

Conversation

@adamdotdevin

@adamdotdevin adamdotdevin commented Sep 20, 2026 •

Copy link
Copy Markdown
Member

Issue for this PR

The full production backfill encountered an R2 SQL 40005 query timeout after pagination was deployed. One transient failure discarded all completed queries in the pass.

Type of change

  • Bug fix

What does this PR do?

Retry the failing page up to twice, with exponential backoff, for R2 query timeouts, HTTP 429, and HTTP 5xx responses. Preserve already-read pages. Syntax, authorization, and unpaginated row-limit errors still fail immediately.

How did you verify your code works?

All 29 stats-core tests pass, including a second-page timeout that recovers without duplicating earlier rows, bounded retry exhaustion, and immediate failure for permanent errors. Stats core/server and repository-wide typechecks plus git diff --check pass. A fresh production replay of the historical query succeeded with 6,736 unique rows after the earlier timeout and HTTP 500 failures.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@adamdotdevin
adamdotdevin enabled auto-merge (squash) September 20, 2026 17:25
@adamdotdevin
adamdotdevin merged commit d870e22 into dev Sep 20, 2026
15 of 16 checks passed
@adamdotdevin
adamdotdevin deleted the retry-stats-timeouts branch September 20, 2026 17:43
rldona pushed a commit to rldona/FlupCode that referenced this pull request Sep 24, 2026
Jovan1666 pushed a commit to Jovan1666/opencode that referenced this pull request Oct 4, 2026
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