-
Couldn't load subscription status.
- Fork 138
feat(client): Use runId only in handles created with getHandle
#468
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
Conversation
| workflowId, | ||
| }); | ||
| const handleFromGet = client.getHandle(workflowId, undefined, { | ||
| firstExecutionRunId: handleFromThrowerStart.originalRunId, |
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.
when should we tell people to use this in docs?
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.
When they want to make sure that they don't terminate / cancel a workflow if it's not part of a specific execution chain.
Co-authored-by: Loren☺️ <[email protected]>
|
Re temporalio/sdk-python#6 (comment), I think we might need to revisit this. For handles returned by start and signal-with-start, we are allowing query, signal, cancel (for signal-with-start), and terminate (for signal-with-start) to occur on a completely different workflow. We should default to using the run ID for all of those I think. // Server 1
const handle = await client.start(nuclearWorkflow,
{ args: ['do not detonate'], taskQueue: 'task-queue', workflowId: 'nuclear-workflow' });
// Meanwhile on server 2
const handle = await client.start(nuclearWorkflow,
{ args: ['detonate'], taskQueue: 'task-queue', workflowId: 'nuclear-workflow' });
// Back on server 1
if (await handle.query('should detonate')) {
launch();
}You just ended the world :-) |
|
For Ideally (may require server change?) we could include |
Not good enough. Firstly that's only for
Yes, there are some changes on the server that can improve this. But as of now in master, the handle returned from start/signal-with-start query of this repo, signal, cancel (signal-with-start only), and terminate (signal-with-start only) can perform an action on a workflow started on another client that is unrelated except by its workflow ID. That is bad I think. |
|
I'm not convinced you're right @cretz. |
|
I think this change is a step in the right direction and we'll make it safer with server changes. |
|
After discussion, while I disagree, the team has decided that for now it's ok to silently and accidentally signal, query, cancel, or terminate incorrect workflows until the server change is in place. |
In addition:
terminateandcancelso handles created withstartcan't accidentally affect workflows that are not part of the same execution chainfirstExecutionRunIdparam togetHandlefor added safety