File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -217,7 +217,10 @@ def _cancel(
217217 activity .cancellation_details .details = (
218218 temporalio .activity .ActivityCancellationDetails ._from_proto (cancel .details )
219219 )
220- activity .cancel (cancelled_by_request = cancel .details .is_cancelled )
220+ activity .cancel (
221+ cancelled_by_request = cancel .details .is_cancelled
222+ or cancel .details .is_worker_shutdown
223+ )
221224
222225 def _heartbeat (self , task_token : bytes , * details : Any ) -> None :
223226 # We intentionally make heartbeating non-async, but since the data
@@ -494,7 +497,8 @@ async def _run_activity(
494497 )
495498 await self ._data_converter .encode_failure (
496499 temporalio .exceptions .ApplicationError (
497- "Unhandled activity cancel error produced by activity pause"
500+ type = "ActivityPause" ,
501+ message = "Unhandled activity cancel error produced by activity pause" ,
498502 ),
499503 completion .result .failed .failure ,
500504 )
You can’t perform that action at this time.
0 commit comments