Skip to content

Retry a D1 overload once before failing that provider - #636

Merged
tombeckenham merged 1 commit into
mainfrom
635-models-poll-a-provider-that-hits-d1-overload-is-failed-and-marked-degraded-instead-of-retried-after-the-wait
Nov 10, 2026
Merged

tombeckenham merged 1 commit into
mainfrom
635-models-poll-a-provider-that-hits-d1-overload-is-failed-and-marked-degraded-instead-of-retried-after-the-wait

Conversation

@tombeckenham

Copy link
Copy Markdown
Collaborator

Summary

  • A models poll that hits a spent D1 window (d1WindowExhausted) waits D1_WINDOW_WAIT_MS and retries that provider once. A second overload still records ingest_failed. A recovered retry records none, and the poll still does not write providers.status.
  • The spec-sync shard does the same. degraded is written only when the retry also fails, and only after the wait, so the status write is not inside the spent window. The 05:11 pair (worldlabs, zai-coding-plan) came from this shard.

Fixes #635

Test plan

  • One D1 overload then a successful poll: second call after the wait, no ingest_failed, status stays active
  • Two overloads in a row: one ingest_failed, no third attempt
  • Spec sync recovers the same way and leaves the provider active
  • Spec sync writes degraded only after a second overload, and the next provider runs after that wait
  • A non-window failure is not retried

A spent D1 window waits D1_WINDOW_WAIT_MS and runs the provider once more, in the models poll and the spec-sync shard. A second overload still records ingest_failed. Spec sync writes degraded only after that second failure, and only after the wait, so a recovered retry stays active.
@changeset-bot

changeset-bot Bot commented Nov 10, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: c1276e0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@tombeckenham
tombeckenham merged commit 20d83eb into main Nov 10, 2026
4 of 5 checks passed
@tombeckenham
tombeckenham deleted the 635-models-poll-a-provider-that-hits-d1-overload-is-failed-and-marked-degraded-instead-of-retried-after-the-wait branch November 10, 2026 07:37
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.

models poll: a provider that hits D1 overload is failed and marked degraded instead of retried after the wait

1 participant