samples-python
samples-python copied to clipboard
Tweak cancellation sample output
Print exception cause chain in each process:
Heartbeating activity
Heartbeating activity
Got expected exception in workflow. Cause chain is ActivityError -> CancelledError
Executing cleanup activity
Heartbeating activity
Got expected exception in client. Cause chain is WorkflowFailureError -> CancelledError
Got expected exception in activity. Cause chain is CancelledError
2025-07-17T18:37:16.228332Z WARN temporal_sdk_core::worker::activities: Activity not found on completion. This may happen if the activity has already been cancelled but completed anyway. task_token=TaskToken(CiQwMTk4MThmOC02N2MyLTdlNjMtYmIwMi1iOTU1MGQ0ODU5ZTESHmhlbGxvLWNhbmNlbGxhdGlvbi13b3JrZmxvdy1pZBokMDE5ODE5YWQtMjA2Ny03ZTM4LTk2ODktNjU0NjA4OTQzNjI2IAUoATIBMUIXbmV2ZXJfY29tcGxldGVfYWN0aXZpdHlKCAgBEPKFQBgB) details=Status { code: NotFound, message: "workflow execution already completed", details: b"\x08\x05\x12$workflow execution already completed\x1aB\[email protected]/temporal.api.errordetails.v1.NotFoundFailure", metadata: MetadataMap { headers: {"content-type": "application/grpc"} }, source: None }