-
Notifications
You must be signed in to change notification settings - Fork 22
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
base: master
Are you sure you want to change the base?
Conversation
lib/cadence/workflow/context.rb
Outdated
@@ -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), |
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.
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 |
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 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
Update version to 0.0.1-pre19
Use a unique ID for each activity execution