-
Notifications
You must be signed in to change notification settings - Fork 141
Nexus task cancellation #1204
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
Nexus task cancellation #1204
Conversation
…_manager. Finish implementing nexus task cancellation
…hat weren't relevant
cretz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing blocking
| @abstractmethod | ||
| async def start_operation( | ||
| self, | ||
| operation: Callable[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not entirely sure about this.
At the workflow level, we should be seeing the ServiceDefinition (i.e. not the implementation), which should not expose the notion of factory-style operation handlers (that's an implementation detail, not part of the public contract of a service).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see what you mean. Removing this and updating the test to define the service and use that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, let's move on with this. We'll review pertinence of all overloads in another issue.
What was changed
Why?
Nexus operation handlers should be able to handle the case where a call
start_operationor call tocancel_operationis interrupted. The most common occurrence of this is a timeout where the call fails to return in time. The new cancellation objects attached to the Nexus operation context allows both sync and async functions to exit early when appropriate.These changes rely on nexus-rpc/sdk-python#31 and is the Temporal specific implementation of nexus-rpc/sdk-python#26.
Checklist
test/nexus/test_workflow_caller_errors.pywere updated to cover: