Fix swallowed CancelledError in start_child_workflow and Nexus operations (Issue #1445)#1472
Open
yegorske50 wants to merge 2 commits intotemporalio:mainfrom
Open
Fix swallowed CancelledError in start_child_workflow and Nexus operations (Issue #1445)#1472yegorske50 wants to merge 2 commits intotemporalio:mainfrom
yegorske50 wants to merge 2 commits intotemporalio:mainfrom
Conversation
Contributor
|
I don't believe this fix is correct, as |
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.
What was changed
Added the
raisestatement to theasyncio.CancelledErrorexcept blocks within_outbound_start_child_workflowand_outbound_start_nexus_operationintemporalio/worker/_workflow_instance.py.Why?
Currently, if a cancellation request occurs while a parent workflow is yielding to start a child workflow or Nexus operation, the
asyncio.CancelledErroris caught to apply the cancel command, but it is not re-raised. Because this happens inside awhile Trueloop, the error is swallowed, causing the parent workflow to completely ignore the cancellation and hang or proceed incorrectly. Re-raising enforces standardasynciocancellation propagation and allows the workflow to shut down gracefully.Checklist
Closes [Bug] CancelledError is swallowed during workflow.start_child_workflow #1445
How was this tested:
start_child_workflow, verifying the cancellation was previously ignored.raisestatement allows the parent workflow to successfully catch theCancelledErrorand shut down.python -m pytest tests/worker/test_workflow.py), confirming no regressions in core workflow execution or deadlock detection.None.