Repository navigation
fix(sentry): stop reporting D1 long-running export blocks - #930
Conversation
Nightly DR D1 exports block other queries with "Currently processing a long-running export". Treat that like SQLITE_BUSY: retry where we already backoff, and drop it in beforeSend so MCP/cron noise during backups does not open Sentry issues.
|
Warning Review limit reached
Next review available in: 44 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
🔎 Preview deployed: https://kody-pr-930.kody-a99.workers.dev Worker: Mocks:
|
Summary
Filters Sentry noise from KODY-CLOUDFLARE-22 and sibling KODY-CLOUDFLARE-21 (
Error: D1_ERROR: Currently processing a long-running export.).Cloudflare D1 blocks other database requests while a REST/API export is in progress. Production events landed on
/mcpduring the nightly DR D1 export window (~02:15 UTC):handleMcpRequest→withAccountWriteLease→ D1 write rejected with that exact message. This is expected platform unavailability during backups, not an application bug — the same class of transient D1 failure asSQLITE_BUSY.This PR extends the existing retryable-D1 matcher so:
runD1WithRetry/ cron lane skip / module-artifact transient detection treat the export message like lock contentionbeforeSend(filterRetryableD1LockSentryEvent) drops matching events so backups do not open or regress Sentry issuesMCP requests can still fail for users while an export holds the DB (Cloudflare limitation; short app retries cannot cover a multi-minute export). We stop treating that as a platform defect in Sentry.
Test plan
d1-retry.node.test.tsmatches bothD1_ERROR: Currently processing…and bare cause-chain forms; retries export errors; still rethrows syntax errors immediatelysentry-options.node.test.tsdrops the production exception chain and keeps unrelated D1 errorsnpm run validategreenSystem recap — composes existing primitives (low risk)
Mode: recap · Base:
main@7b2e5749· Head:34a9865bClassification: composes — narrow extension of the existing D1 transient matcher + Sentry
beforeSendfilter; no D1 schema, auth, or backup export contract changes.Primitives touched
d1-retry.ts/sentry-options.tsSystem map
Nightly DR D1 exports still block production queries; Sentry and cron/retry paths no longer treat that block as a novel platform failure.
Legend: green = composes (wiring only) · amber = extended by this PR · red = new primitive · gray = context (unchanged, included only when an edge crosses it).