Skip to content

Document that D1 binding has no per-call timeout option - #34310

Merged
neelakolkar-cf merged 2 commits into
cloudflare:productionfrom
shanecloudflare:dee-3968-d1-binding-no-per-call-timeout
Oct 21, 2026
Merged

neelakolkar-cf merged 2 commits into
cloudflare:productionfrom
shanecloudflare:dee-3968-d1-binding-no-per-call-timeout

Conversation

@shanecloudflare

Copy link
Copy Markdown
Contributor

Summary

Addresses the documentation gap surfaced in support case 02374690 (DEE-3968).

None of the D1 Worker API, D1 limits, Debug D1, or Workers limits pages explains whether a D1 binding call has a timeout, what happens when the database is unreachable, or how to bound the wait. Customers assume an error should surface automatically and escalate to Engineering.

Changes

src/content/docs/d1/observability/debug-d1.mdx

Added a new "D1 binding timeout behavior" section covering:

  • run(), all(), first(), and batch() accept no timeout option or AbortSignal — there is no per-call timeout in the D1 binding client.
  • Workers have no wall-time limit on incoming HTTP requests while the client connection is open (Workers limits: Incoming HTTP request: wall time Unlimited). The 30-second figure in D1 limits (footnote 4) applies to Cloudflare API requests, not binding calls.
  • Promise.race pattern to bound the wait, with an explicit caution: it does not cancel the query — a timed-out write may still commit, so outcome must be confirmed before retrying.

Note for reviewers: The original ticket suggested documenting an AbortController example and a "30-second Worker request timeout". Both are incorrect — D1 binding methods have no signal parameter, and Workers wall time is Unlimited. These corrections were flagged in the ticket by the MCP agent (Dane Knecht's review in support MR !1781). The actual blocking behavior when the backing Durable Object is unreachable is not yet confirmed by D1 engineering; this PR documents only what is verifiably true from the public API shape and limits pages.

Testing

Documentation-only change.

@github-actions github-actions Bot added the product:d1 D1: https://developers.cloudflare.com/d1/ label Oct 14, 2026
@cloudflare-docs-bot

cloudflare-docs-bot Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

AI Review

✅ Reviewed 1275895 · 1 finding · incremental

👉 Fix in your agent 👈
Fix the following review findings in PR #34310 (https://github.com/cloudflare/cloudflare-docs/pull/34310).

Before making changes, review each finding and present a brief summary table:
- For each finding, state whether you agree, disagree, or need clarification.
- If you disagree, explain why.
- If you need clarification before deciding, ask those questions.
- Then share your plan for which issues to tackle and in what order.

After triaging, follow this order:
1. Post a comment on this PR for any findings you are skipping, with the finding ID and your reasoning.
2. Then commit the fixes for the legitimate findings.

The comment must come before the commit because the next review reads PR comments.

## Style Guide
- S-130f42ba | src/content/docs/d1/observability/debug-d1.mdx:126 | Use `refer to` instead of `see` before a link
  The links rule requires `see [link]` phrasing to be replaced with `refer to [link]`. This line uses `see [Workers limits](/workers/platform/limits/)` before the internal link.

Style Guide

  • src/content/docs/d1/observability/debug-d1.mdx:126 · Use refer to instead of see before a link

    The links rule requires see [link] phrasing to be replaced with refer to [link]. This line uses see [Workers limits](/workers/platform/limits/) before the internal link.

Commands
  • /review Run a review now.
  • /full-review Review the entire PR diff.
  • /disable-auto-review Stop automatic reviews.
  • /rebase Rebase against production.

@shanecloudflare shanecloudflare changed the title [DEE-3968] docs(d1): document that D1 binding has no per-call timeout option Document that D1 binding has no per-call timeout option Oct 14, 2026
@shanecloudflare
shanecloudflare force-pushed the dee-3968-d1-binding-no-per-call-timeout branch from c7e913d to 211d172 Compare October 14, 2026 22:52
Comment on lines +85 to +75
| `D1 DB exceeded its CPU time limit and was reset.` | A query is taking up a lot of CPU time (e.g. scanning over 9 GB table, or attempting a large import/export). | App action: Split the query into smaller shards. |
| `D1 DB reset because its code was updated.` | Cloudflare has updated the code for D1 (or the underlying Durable Object), and the Durable Object which contains the D1 database is restarting. | Re
[...truncated]

@lambrospetrou lambrospetrou Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is broken. I don't expect that you wanted to delete the entire table add ...truncated here right?

Same for the sections below that are deleted.

@shanecloudflare
shanecloudflare force-pushed the dee-3968-d1-binding-no-per-call-timeout branch from 211d172 to 776bf97 Compare October 15, 2026 17:07
@github-actions github-actions Bot added the product:workers Related to Workers product label Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

Hi @lambrospetrou — you're right and I apologise for that. The root cause: previous commits were generated by encoding file content via the GitHub Contents API, which truncated files above ~8KB before base64-encoding. For debug-d1.mdx (120 lines, >8KB) that stripped the bottom half of the error table and replaced it with [...truncated].

The branch has been force-pushed with a clean commit generated directly from git in the sandbox — the diff now only adds the new ## D1 binding timeout behavior section at the bottom of the unmodified file. All other rows in the error table are preserved.

Happy to have you re-review when you get a chance.

@shanecloudflare
shanecloudflare force-pushed the dee-3968-d1-binding-no-per-call-timeout branch from 776bf97 to 4f045cc Compare October 15, 2026 17:41
@github-actions github-actions Bot removed the product:workers Related to Workers product label Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

Hi @lambrospetrou — correct, that was a truncation bug. The branch has been force-pushed with a clean commit that only adds the new ## D1 binding timeout behavior section at the bottom of the full, unmodified file. The diff no longer deletes any rows from the error table.

Sorry for the noise — the previous commits were generated via the GitHub Contents API which silently truncates files above ~8KB. That path has been replaced with a git-based approach that verifies file integrity before pushing.

Comment thread src/content/docs/d1/observability/debug-d1.mdx Outdated
@neelakolkar-cf

Copy link
Copy Markdown
Collaborator

@lambrospetrou Is the work on this PR done - LGTM?

@neelakolkar-cf
neelakolkar-cf added this pull request to the merge queue Oct 21, 2026
Merged via the queue into cloudflare:production with commit bce5a7b Oct 21, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:d1 D1: https://developers.cloudflare.com/d1/ size/s

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants