Skip to content

STOR-5615: Make the Durable Object retry option public - #8143

Merged
apeacock1991 merged 1 commit into
mainfrom
apeacock/STOR-5615-do-retry-option-ga
Nov 3, 2026
Merged

apeacock1991 merged 1 commit into
mainfrom
apeacock/STOR-5615-do-retry-option-ga

Conversation

@apeacock1991

Copy link
Copy Markdown
Contributor

Workers can now pass retry to DurableObjectNamespace's get(), getByName() and getExisting() without the experimental flag. The option still applies only while the DURABLE_OBJECT_RETRIES_USERLAND autogate is on.

env.MY_DO.getByName("foo", { retry: { maxRetries: 1, timeoutMs: 2000 } });

retry moves into GetDurableObjectOptions, and GetDurableObjectOptionsWithRetry and the *WithRetry methods are removed. That struct is also how experimental Workers saw version in their types, so GetDurableObjectOptions now has the experimental-only TypeScript override for version.

The main types snapshot gains retry and DurableObjectRetryOptions. The experimental snapshot only reorders two declarations.

@apeacock1991
apeacock1991 marked this pull request as ready for review November 2, 2026 10:33
@apeacock1991
apeacock1991 requested review from a team as code owners November 2, 2026 10:33

@clanky-the-clanker clanky-the-clanker Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Superseded by the review of ce669838.

This review, of 965ee080

💬 Approved with comments — Clean refactor with one WARNING: retry is now validated for every Worker regardless of the autogate. Existing Workers that pass a malformed retry key, which used to be ignored, will now throw, and the commit message does not record this compatibility decision.

Findings: 1 warning (1 is an inline comment on the diff)

Not opened by the correctness review: 2 changed files it was meant to read
  • types/generated-snapshot/experimental/index.ts
  • types/generated-snapshot/index.ts

The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.

🔧 Fix with your agent

Paste the following into your coding agent to investigate and fix these issues.

Fix the following code review issues found in pull request #8143.

Before making changes, review each issue and present a brief summary table:
- For each finding, state whether you agree, disagree, or need clarification
- If you disagree (e.g., the fix would require disproportionate changes
  for minimal ROI, or the finding is factually incorrect), explain why
- If you need to clarify something before deciding, ask those questions
- Then share your plan for which issues to tackle and in what order

## WARNING (1)

### [Code Quality] `retry` is now validated for every Worker, before the autogate check. Existing non-experimental Workers that pass a malformed `retry` key, which used to be ignored, now throw from get()/getByName()/getExisting(), and the commit message does not record this compatibility decision.
- **File:** src/workerd/api/actor.h:287

📋 Code Quality: ⚠️ 1 warning

The refactor is clean. retry validation now applies to every Worker, not only experimental ones, and happens even with the autogate off.

Recommendation: 📝 Minor Comments

  • [WARNING] retry is now validated for every Worker, before the autogate check. Existing non-experimental Workers that pass a malformed retry key, which used to be ignored, now throw from get()/getByName()/getExisting(), and the commit message does not record this compatibility decision. (src/workerd/api/actor.h:287)
View full review
  • retry validation is no longer gated (src/workerd/api/actor.h:265-287, src/workerd/api/actor.c++:280-286).
    • Before: Workers without experimental received the plain GetDurableObjectOptions, which never read retry, so any value was ignored. The removed test "ignores the retry option without the experimental flag" asserted exactly this.
    • Now: every get(), getByName() and getExisting() call converts retry through toUserDefinedRetryPolicy, and that happens before the DURABLE_OBJECT_RETRIES_USERLAND check. Values such as retry: null, retry: 5, { maxRetries: '1' } or { maxRetries: 11 } now throw a TypeError or RangeError.
    • Wording: the description and the struct comment say the option "applies only while the autogate is on". That is true of applying the policy, but not of validating it.
    • Why it matters: the repository's compatibility guidance says autogates do not preserve existing Workers' API surface, and that changes to the API surface should record their compatibility decision in the commit message. The commit message does not record one.
    • Fix: either gate the read and the validation behind the autogate or a compatibility flag, or explicitly accept the risk in the commit message.

✅ All other checks passed

🔒 Security: ✅ LGTM

No security issues found.


📖 AGENTS.md: ✅ LGTM

No AGENTS.md issues found.


⚡ Performance: ✅ LGTM

The work in getImpl has the same shape as before. The change adds no new loops, allocations or I/O.


📝 Documentation: ✅ LGTM

No documentation issues found.


Reviewed commit: 965ee080

Comment thread src/workerd/api/actor.h Resolved
Workers can now pass `retry` to DurableObjectNamespace's get(),
getByName() and getExisting() without the `experimental` flag. The
option still applies only while the DURABLE_OBJECT_RETRIES_USERLAND
autogate is on.

Move `retry` into GetDurableObjectOptions and remove
GetDurableObjectOptionsWithRetry and the *WithRetry methods. That
struct is also how experimental Workers saw `version` in their
types, so GetDurableObjectOptions now has the experimental-only
TypeScript override for `version`.
@apeacock1991
apeacock1991 force-pushed the apeacock/STOR-5615-do-retry-option-ga branch from 965ee08 to ce66983 Compare November 2, 2026 10:49

@clanky-the-clanker clanky-the-clanker Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💬 Approved with comments — Clean refactor with no correctness, security or performance issues. One INFO remains: the commit message should record the decision that malformed retry values now throw for all Workers.

Findings: 1 info

Not opened by the correctness review: 2 changed files it was meant to read
  • types/generated-snapshot/experimental/index.ts
  • types/generated-snapshot/index.ts

The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.


📋 Code Quality: 💬 1 info

Refactor is consistent; one INFO about recording the compatibility decision in the commit message.

Recommendation: 💬 Optional Nits

  • [INFO] Lowered to INFO: @​apeacock1991 [author] says validating retry for every Worker is intended, and the code matches. The commit message still does not record that malformed retry values, which used to be ignored, now throw for existing Workers. The repository's backward-compatibility guidance asks for that decision to be stated there explicitly. (src/workerd/api/actor.h:287)
View full review
  • Merging GetDurableObjectOptionsWithRetry into GetDurableObjectOptions is consistent across the code, tests and type snapshots:
    • getImpl has a single overload.
    • The methods are registered without the experimental gate.
    • version stays experimental-only in TypeScript.
    • The type registration list is updated.
  • actor-stub-test.wd-test drops experimental, so the public path is now under test.
  • Earlier WARNING, now INFO. retry is validated through toUserDefinedRetryPolicy for every Worker, before the autogate check.
    • Lowered to INFO: @​apeacock1991 [author] replied that this validation is intended, and getImpl matches that.
    • The repository's backward-compatibility guidance asks that changes to the Worker API surface record their compatibility decision in the commit message. The commit message only says the option "applies only while the autogate is on". It does not mention that malformed retry values, which used to be ignored, now throw a TypeError or RangeError for existing Workers.
    • Adding one sentence that accepts this risk would close the point.

✅ All other checks passed

🔒 Security: ✅ LGTM

retry is still range-checked through toUserDefinedRetryPolicy. The policy is applied only when the DURABLE_OBJECT_RETRIES_USERLAND autogate is on. The jurisdiction and routingMode checks are unchanged.


📖 AGENTS.md: ✅ LGTM

No AGENTS.md issues found.


⚡ Performance: ✅ LGTM

getImpl has the same shape as before. The change adds no loops, allocations or I/O.


📝 Documentation: ✅ LGTM

No documentation issues found.


Reviewed commit: ce669838

@petebacondarwin
petebacondarwin removed the request for review from dario-piotrowicz November 2, 2026 18:12
@apeacock1991
apeacock1991 merged commit 7bcdb8f into main Nov 3, 2026
25 of 26 checks passed
@apeacock1991
apeacock1991 deleted the apeacock/STOR-5615-do-retry-option-ga branch November 3, 2026 19:19
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.

3 participants