Repository navigation
fix(workspaces): retry Durable Object resets when a document session opens - #860
Draft
posthog[bot] wants to merge 2 commits into
Draft
posthog[bot] wants to merge 2 commits into
posthog[bot] wants to merge 2 commits into
Conversation
…opens partyserver retries only errors with retryable === true. A Durable Object storage reset does not set that flag, so one reset failed the whole workspace_read_items call. getDocumentSessionFromEnv now retries transient Durable Object errors (retryable, durableObjectReset, or a reset message) up to 3 attempts, and records a document_session_open_retry event. observeWorkspaceOperation records a transient reset that outlasts the retries as a rejected outcome, not as an exception capture. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: 40a5012c-8f27-43f5-b6fb-b6eb1863e035
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
|
React Doctor found no new issues. 🎉 Reviewed by React Doctor for commit |
Use the shared isRecord guard, name the document session input type, and share the common fields of the workspace operation outcome. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: 40a5012c-8f27-43f5-b6fb-b6eb1863e035
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
workspace_read_itemscall from one transient Cloudflare fault. The whole read fails, including the other items in the batch.getServerByNamewhen the document session opens.retryable === true. This reset does not set that flag, so no retry occurs.observeWorkspaceOperationthen captures the platform fault as an exception, which opens an error tracking issue.Origin
9dd7b60Changes
getDocumentSessionFromEnvmakes a maximum of 3 attempts, with a 100 ms / 200 ms backoff. It setsroutingRetry: false, so only one retry policy applies.isTransientDurableObjectError):retryable,durableObjectReset, or a "caused object to be reset" message. Overloaded errors never retry.document_session_open_retrywithattemptsandrecovered.rejectedworkspace_operationoutcome with the error fields. It is not an exception capture. Other errors are captured as before.document_session_open_retry(recovered: true)rejectedoutcome, no exceptionNote
The retry applies to all callers of
getDocumentSessionFromEnv: read, edit, edit review, and PDF export. A session open is idempotent: it only awaitsonStart(), so a retry is safe.Testing
vp checkpasses: format, lint, types.tsc --noEmitpasses.src/features/workspacespass, including new tests for retry, attempt limit, no retry for overloaded or other errors, and the rejected classification.mcp-operation-cataloganddocument-session-revocationpass.pnpm verifybuild. I did not reproduce a real storage reset, because Cloudflare cannot inject one locally.Agent context
WorkspaceKernelmodule, so it does not cover this path.routingRetryoption alone. Its predicate checks onlyretryable, and this reset does not set that flag.Closes #859
Refs #784
Created with PostHog Desktop from this inbox report.
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.