Repository navigation
Conversation
Unaccepted polls aborted with WorkflowNotReadyFailure during continue-as-new are retried instead of ending the subscription. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
|
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
I ran the deterministic loopback reproduction from #2170 against main Replayed with Codex assistance. |
What was changed
WorkflowStreamClient.subscribe()now retries a poll aborted before acceptance withFAILED_PRECONDITIONand aWorkflowNotReadyFailuredetail. That is the error the server produces when a publish lands in the workflow task that emits continue-as-new. The retry is limited to the unaccepted case: accepted-run errors, generic RPC errors, cancellation, and terminal handling are unchanged.The public docstring now states that unaccepted polls aborted with
WorkflowNotReadyFailureare retried. Achangelog/fixed/fragment is included. The fix uses only local per-attempt state; it adds no cache, client, connection, loop, timer, or retained global state.Why?
Issue #2170 reports that a healthy token-stream subscriber dies because
subscribe()describes the run, seesRUNNING, and re-raises the aborted poll error. The method already retries unaccepted polls forStreamDrainingand promises to follow continue-as-new chains. A stress reproduction lost 6 of 20 subscribers at rollover under publish load.Checklist
Closes [Bug] workflow_streams: subscribe() raises RPCError when a publish signal lands during the continue-as-new workflow task #2170
How was this tested:
ce8cd48149423e005302ae0b4ea5f5488d90a4f3+ new tests: 1 failed, 1 passed. The retry test failed with the reportedRPCError.ruff check --select Iandruff format --checkpass on both changed Python files;git diff --checkpasses.uvdev install timed out downloading the unrelatedcibuildwheelpackage, so tests ran with the local Python 3.11 environment and the installed native bridge shim. Integration tests requiring a Temporal dev server were not run.Any docs updates needed?
subscribe()docstring and added achangelog/fixed/fragment. No docs.temporal.io update is needed.🤖 Generated with Claude Code