-
Notifications
You must be signed in to change notification settings - Fork 49
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
Prevent creating multiple workflow instances with the same instance id #260
Comments
thought: perhaps it's best to follow Temporal's lead and allow the user to set an ID reuse policy A simplified binary allow/reject duplicate option should satisfy most use cases. Could probably simply be used as a hint for whether or not to generate a random execution ID? Or would it be reasonable to expose the execution ID to the client API? EDIT: Side note: it currently feels a little awkward to serialize a workflow instance for later reference, e.g. to cancel a workflow at a later time. The reason being that the workflow instance is passed to the client API as an alias to a |
Another thing to note is that instance ID reuse has an impact on signaling. Today, the behavior for signaling instances with multiple active executions is undefined at the Backend level. Looking anecdotally at the mysql backend, I see that we just snag one execution to signal. It might be reasonable to instead perform a broadcast of sorts, so that all active executions receive the signal. |
When I encountered this first, I looked at the potential options to enable some uniqueness in the schema without interfering too much with the codebase. Unfortunately, making instance id unique individually has implications for functionalities like This led me to think that decoupling instance definition and execution may provide more flexibility.
The reuse policy definition is a good way to provide optionality, 👍 |
There should only be one active execution at any point in time. If there are multiple, that's a bug and not as designed. |
Closed in #288 |
Two subsequent
CreateWorkflowInstance
calls with the same id should result in an error.Discussed in #259
The text was updated successfully, but these errors were encountered: