diff --git a/temporalio/worker/_workflow_instance.py b/temporalio/worker/_workflow_instance.py index 2809e788..8563fbed 100644 --- a/temporalio/worker/_workflow_instance.py +++ b/temporalio/worker/_workflow_instance.py @@ -1594,6 +1594,7 @@ def apply_child_cancel_error() -> None: # If the cancel command is for external workflow, we # have to add a seq and mark it pending if cancel_command.HasField("request_cancel_external_workflow_execution"): + assert False, "request_cancel_external_workflow_execution" cancel_seq = self._next_seq("external_cancel") cancel_command.request_cancel_external_workflow_execution.seq = ( cancel_seq @@ -1609,9 +1610,7 @@ async def run_child() -> Any: while True: assert handle try: - # We have to shield because we don't want the future itself - # to be cancelled - return await asyncio.shield(handle._result_fut) + return await handle._result_fut except asyncio.CancelledError: apply_child_cancel_error() @@ -1625,9 +1624,7 @@ async def run_child() -> Any: # Wait on start before returning while True: try: - # We have to shield because we don't want the future itself - # to be cancelled - await asyncio.shield(handle._start_fut) + await handle._start_fut return handle except asyncio.CancelledError: apply_child_cancel_error()