Skip to content

Conversation

@carlcortright
Copy link
Contributor

Use a unique ID for each activity execution


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