Skip to content

Conversation

tconley1428
Copy link
Contributor

What was changed

Check for the reset flag on cancellation details and propagate the information to the user.

Why?

Checklist

  1. Closes [python] SDK support for activity reset  #847

  2. How was this tested:
    New activity test.

  3. Any docs updates needed?

@tconley1428 tconley1428 requested a review from a team as a code owner August 28, 2025 18:12
Copy link
Contributor

@THardy98 THardy98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

elif (
isinstance(
err,
(asyncio.CancelledError, temporalio.exceptions.CancelledError),
)
and running_activity.cancellation_details.details
and running_activity.cancellation_details.details.paused
):
temporalio.activity.logger.warning(
"Completing as failure due to unhandled cancel error produced by activity pause",
)
await self._data_converter.encode_failure(
temporalio.exceptions.ApplicationError(
type="ActivityPause",
message="Unhandled activity cancel error produced by activity pause",
),
completion.result.failed.failure,
)

You will need to add a corresponding conditional branch here for activity reset.

Might also be worth having a test with a synchronous activity as well.

@tconley1428 tconley1428 merged commit a004faa into main Sep 3, 2025
53 of 64 checks passed
@tconley1428 tconley1428 deleted the reset_activity branch September 3, 2025 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[python] SDK support for activity reset

2 participants