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

Support for workflow ID conflict policy #579

Merged
merged 1 commit into from
Jul 12, 2024

Conversation

cretz
Copy link
Member

@cretz cretz commented Jul 12, 2024

What was changed

  • Added id_conflict_policy to workflow start/execute and added test

Checklist

  1. Closes Support for WorkflowIdConflictPolicy #504

@cretz cretz requested a review from a team as a code owner July 12, 2024 16:39
Comment on lines +463 to +466
id_conflict_policy: How already-running workflows of the same ID are
treated. Default is unspecified which effectively means fail the
start attempt. This cannot be set if ``id_reuse_policy`` is set
to terminate if running.
Copy link
Member

Choose a reason for hiding this comment

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

Should we just default it to FAIL then? Otherwise we're sort of at the mercy of whatever server feels like, which could either be a good thing or a bad thing depending on how you look at it.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is what we wanted to do, but unfortunately we can't. Unfortunately the server in temporalio/temporal#5507 will fail you if you do not set unspecified and you try to set terminate-if-running id reuse policy. This is an admitted unfortunate server case where unspecified is not treated the same as its default.

So if we default this to fail, a user's code that sets id reuse policy to terminate-if-running will start failing (they both cannot be set). This is the rare case where we have to leave it unset/unspecified as the default. This is why I document what the real default is, because users can't see it as the default param option.

@cretz cretz merged commit c57df81 into temporalio:main Jul 12, 2024
12 checks passed
@cretz cretz deleted the workflow-id-conflict-policy branch July 12, 2024 18:16
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.

Support for WorkflowIdConflictPolicy
2 participants