If I deploy new durable functions code, what happens to workflows still in progress? #2114
Replies: 1 comment
-
Assuming you’re using the default Azure Storage provider, Activities are triggered by queue-messages under the hood. If you update your deployment with new code, and let’s assume that the App host is scaled out to a couple of instances, there’s no guarantee that they will all start executing the new deployment at the exact same time. So it’s likely that there will be a window of time where some Activities will be running old code (on hosts that haven’t been deployed yet) and some new code (hosts that have been updated) Some activities may even be terminated mid-process, which is more likely if an Activity is long running. In which case, that Activity instance will get picked up by one of the other competing hosts once the visibility timeout has elapsed ( I think the default is 5 min) If you want to better handle a termination mid-process, you can use a CancellationToken passed into the function from the Host. https://docs.microsoft.com/en-us/azure/azure-functions/functions-dotnet-class-library?tabs=v2%2Ccmd#cancellation-tokens |
Beta Was this translation helpful? Give feedback.
-
Let's say I have a durable function activity that calls some helper method that moves some data.
I make a change in the way that data is moved and deploy said code.
If a process started before my deploy and was in the middle of that activity, when it runs it will just use the new code?
If our change is incompatible with the previous state then there will be breakage there and we'll just have to plan for that.
Is that accurate?
Beta Was this translation helpful? Give feedback.
All reactions