Azure durable function , "at least once execution" and python call_activity

Wiktor Falana 0 Reputation points
2023-08-23T17:26:03.8333333+00:00

Somewhat related to
https://learn.microsoft.com/en-us/answers/questions/164869/help-me-understand-why-activity-functions-should-b

I am using python, all activity functions are called via from orchestrator via call_activity method ( https://learn.microsoft.com/en-us/python/api/azure-functions-durable/azure.durable_functions.models.durableorchestrationcontext.durableorchestrationcontext?view=azure-python#azure-durable-functions-models-durableorchestrationcontext-durableorchestrationcontext-call-activity )

and NOT call_activity_with_retry

In this case, does this part of documentation still apply?
"The Durable Task Framework guarantees that each called activity function will be executed at least once during an orchestration's execution."
I am specifically interested whether it is still possible that the activity will be run MORE than once even though I have not set any retry policy (as far as I can tell from the code call_activity does not set any retry options for the task)?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,887 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Mike Urnun 9,801 Reputation points Microsoft Employee
    2023-09-07T17:14:28.2+00:00

    Hello @Wiktor Falana - Thanks for reaching out, and sorry for the late reply on this thread. To answer your question, yes, the statement regarding the "at least once execution" from call_activity method still applies irrespective of the language runtime as that is a by-design behavior built within the Durable Task framework.

    Activity functions can still run more than once due to service faults that may occur in the underlying mechanism (separation of compute-storage for keeping track of executions instead of runtime checkpointing). For example, if an activity function executes and an app crashes before the activity function execution is recorded in Durable state, the next time the app restarts the activity function will be re-executed because the previous execution wasn't recorded in the underlying queue -- although this should be very rare.

    Lastly, for a better understanding of Durable Functions & its fundamentals, I highly recommend the following read: Durable Functions: Semantics for Stateful Serverless

    I hope this helps! If you have any further questions, feel free to let us know in the comments. Thanks!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.