-
Notifications
You must be signed in to change notification settings - Fork 89
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
Fixed has_release? when called in multiple windows #168
base: master
Are you sure you want to change the base?
Fixed has_release? when called in multiple windows #168
Conversation
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.
@cvanderschuere thanks a lot for the PR 👍
Can you please help me understand your thought process here?
Originally I've implemented this in a way where you can expect a has_release?('version')
to return the same value within a single workflow instance no matter at what point the new code got deployed. The reasoning here is simple — you can add a change with the same condition to different parts of the workflow code and expect it to either always be true
or false
, but never change the value along the way.
I can definitely see how your example is also valid where you want the new release to affect the loops that haven't yet happened. But this breaks the previous assumption
The main use case that is not well supported right now is for long running workflows (specifically those with loops). If you have a workflow that runs for days or even weeks, there is currently no good way to make safe / deterministic updates and that's a critical feature for us. As far as tools to make breaking changes, there are currently two approaches: version the entire workflow (i.e. WorkflowV1, WorkflowV2, etc) or use For workflows that are short (i.e. minutes), the current approach works just fine:
The problem is when the max workflow duration is longer than a tolerable time to make changes. In our case, workflows can last for weeks which is more than tolerable. I see two paths forward: I would favor option A, but would be curious to hear use-cases where that would be a significant breaking change. |
@cvanderschuere thanks for explaining this 🙌 What you're describing does make sense and it might be a better default behaviour. However it is a breaking change if there are people right now who depend on the old behaviour. There might be a 3rd option which is a compromise — either add a new method or add a flag (e.g. What do you think? |
Currently
has_release
does not work with long running workflows. Once has_release has been hit once, it will never change its value for the lifetime of a workflow.Example
Original
Modification
The desired outcome with releasing this modification is that all future loops will call the new code, but previous tasks will execute the original version. Prior to this PR, the original code will always be executed.
With this change, here are the possible scenarios:
has_release
seen for the first time when not replaying --- mark releasehas_release
seen for the first time while replaying --- set tofalse
locallyhas_release
seen for first time while replaying and then again while not replaying -- mark releasehas_release
seen for first time when not replaying and then again while not replaying -- use previous value / don't mark release