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

Unique Activity ID #5

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Unique Activity ID #5

wants to merge 3 commits into from

Conversation

carlcortright
Copy link
Contributor

Use a unique ID for each activity execution

@@ -35,7 +35,7 @@ def execute_activity(activity_class, *input, **args)
execution_options = ExecutionOptions.new(activity_class, options)

decision = Decision::ScheduleActivity.new(
activity_id: options[:activity_id],
activity_id: UUID.v5(metadata.run_id, activity_class.to_s + input.to_s + args.to_s),
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this will work, because there's a chance that you might need to schedule the same activity with the same arguments more than once and it will result in a duplicate ID

# sequence of decision tasks
idem_activity_id = UUID.v5(
metadata.run_id,
activity_class.to_s + input.to_s + args.to_s + @history.events.length.to_s
Copy link
Contributor

@antstorm antstorm Apr 7, 2020

Choose a reason for hiding this comment

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

This has the same issue as using the current implementation of the activity ID — upon restarting the workflow @history.events.length will change.

This solution is also not replay friendly since @history.events.length will change between different re-runs

jordanwnolan pushed a commit to jordanwnolan/cadence-ruby that referenced this pull request Jan 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants