Skip to content
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 #185

Merged
merged 5 commits into from
Jan 23, 2025

Conversation

qianl15
Copy link
Member

@qianl15 qianl15 commented Jan 23, 2025

This fix is similar to the one in TypeScript: dbos-inc/dbos-transact-ts#726

  • This PR mainly addresses the issue where different workflows started with the same workflow ID breaks the OAOO guarantees. 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.
  • Plus, if multiple workflow started within the SetWorkflowID block, only the first workflow will be assigned with the specified workflow ID; subsequent workflows will use a generated workflow ID. Make sure we have a clear warning message for users.
  • 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.
  • It also fixes the Kafka consumer workflow IDs and adds a way to generate a group ID based on the function name and topics. This should match the TS implementation.

@qianl15 qianl15 requested a review from chuck-dbos January 23, 2025 01:25
@qianl15 qianl15 requested a review from kraftp January 23, 2025 01:33
dbos/_kafka.py Outdated Show resolved Hide resolved
Copy link
Member

@kraftp kraftp left a comment

Choose a reason for hiding this comment

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

Great fix!

dbos/_context.py Outdated Show resolved Hide resolved
@qianl15 qianl15 merged commit cb8b9dc into main Jan 23, 2025
5 checks passed
@qianl15 qianl15 deleted the qian/fix-conflict-workflow branch January 23, 2025 17:29
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.

2 participants