-
Notifications
You must be signed in to change notification settings - Fork 34
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 different workflows starting with the same ID #726
Conversation
This reverts commit b7541e6.
Co-authored-by: Peter Kraft <peter.kraft@dbos.dev> Signed-off-by: Qian Li <liqian.cs@gmail.com>
const logger = this.executor!.logger; | ||
try { | ||
// This combination uniquely identifies a message for a given Kafka cluster | ||
const workflowUUID = `kafka-unique-id-${topic}-${partition}-${consumerConfig.groupId}-${message.offset}` |
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.
@chuck-dbos I added error handling and included consumer group ID in the workflow ID. The test seems to pass now. But maybe you have a better solution for this issue.
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.
This is a good and necessary change. Like Chuck said, we need a better way of generating default consumer group IDs, but that's a separate PR.
This PR addresses issue #725 where duplicate workflow ID breaks the existing workflow. The solution is to check the recorded function name, class name, and config name (if any) before proceeding to start the workflow. If there's any difference, throw a
DBOSConflictingWorkflowError
with a clear error message.This PR also checks the recorded input versus the provided input, and the provided queue name versus the original queue name, and print a warning message if they don't match.