fix: fail task when update handler continues as new - #1708
Open
Sakshamm-Goyal wants to merge 2 commits into
Open
fix: fail task when update handler continues as new#1708Sakshamm-Goyal wants to merge 2 commits into
Sakshamm-Goyal wants to merge 2 commits into
Conversation
tconley1428
reviewed
Jul 31, 2026
Contributor
Author
|
Corrected the inaccurate comment in 592e6e6. Continue-as-new is now documented as valid only from the top-level workflow; the update-handler path fails the workflow task rather than allowing that control-flow exception to escape. The change is comment-only and source compilation passes. |
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.
Fixes #436.
ContinueAsNewErrorderives fromBaseException, so the update-handler task bypassed the normal update exception path and escaped as an unobserved detached-task exception. The update never completed and the workflow task was not failed.Treat that control-flow exception as a workflow-task failure in the update path. On retry, the update can complete normally; it never continues the workflow from the update handler.
Regression coverage proves the baseline failure (an unhandled update task and timed-out update RPC) and verifies the retry completes after exactly one task failure.
Validation:
pytest tests/worker/test_workflow.py::test_workflow_update_continue_as_new_fails_task tests/worker/test_workflow.py::test_workflow_update_task_fails tests/worker/test_workflow.py::test_workflow_update_handlers_unhappy -q(3 passed)ruff format --check temporalio/worker/_workflow_instance.py tests/worker/test_workflow.pygit diff --checkNote: whole-file Ruff reports seven existing diagnostics in unrelated lines of
tests/worker/test_workflow.py.