Skip to content

Clarity on client thread safety and sync activity cancel #189

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 7, 2022

Conversation

cretz
Copy link
Member

@cretz cretz commented Nov 4, 2022

What was changed

  • Clarify that clients are not thread safe (and really should use the same event loop too to ensure this)
  • Clarify (and make minor change to support) that sync activities have to explicitly throw CancelledError to have an activity appear as cancelled (we are still discussing internally if we can do this better)

Checklist

  1. Closes Clarify story around using a client from a different asyncio loop than it was created in #147
  2. Relates to but does not completely close Clarify story around sync activity cancellation #146

@cretz cretz requested a review from a team November 4, 2022 17:06
react appropriately. An activity must heartbeat to receive cancellation and there are other ways to be notified about
cancellation (see "Activity Context" and "Heartbeating and Cancellation" later).
react appropriately. If after cancellation is obtained an unwrapped `temporalio.exceptions.CancelledError` is raised,
the activity will be marked cancelled. An activity must heartbeat to receive cancellation and there are other ways to be
Copy link
Member

Choose a reason for hiding this comment

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

Should we mention heartbeating only applies to non-local activities?

Copy link
Member Author

@cretz cretz Nov 7, 2022

Choose a reason for hiding this comment

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

Maybe. It seems most of our documents don't make this differentiation, e.g. https://docs.temporal.io/application-development/features#activity-heartbeats. Note that doesn't say a thing about "local" wrt heartbeats. Hopefully this doc is removed in favor of that one. Let's try to get it right there.

@cretz cretz merged commit 87fd193 into temporalio:main Nov 7, 2022
@cretz cretz deleted the misc-updates5 branch November 7, 2022 16:08
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.

Clarify story around using a client from a different asyncio loop than it was created in Clarify story around sync activity cancellation
3 participants