Azure/azure-functions-durable-extension

RetryOptions in Isolated worker model

Closed this issue · 2 comments

We are moving away from in-process based function to the isolated worked mode.

Seems that there is no feature parity when it comes to different implementation of the durable functions.

One example is the following.
In InProc we used to do the following:

private static readonly RetryOptions retryOptions = new(TimeSpan.FromSeconds(pollingInterval), maxRetries) { Handle = RetryStatusErrorHandler };
DurableOrchestrationStatus durableOrchestrationStatus = await context.CallActivityWithRetryAsync<DurableOrchestrationStatus>(
    nameof(ServiceConnectionProvisioningActivities.ServiceConnectionGetProvisionStatusActivity), retryOptions, orchestrationId);

where the callback function for the Handle looked like this

private static bool RetryStatusErrorHandler(Exception ex)
{
    if (ex.InnerException is RunningOrchestrationException)
    {
        return true;
    }

    return false;
} 

Now the same does not seem possible in isolate process

CallActivityAsync can handle the retry via TaskOptions. However, task options can be created from the retry policy or from the handle, but not from both. How do we retry only on a certain exception and still specify the max number of attempts and the retry interval? Seems not possible in the isolated worker durable function.

Any suggestion is welcome.

@MarioMajcicaAtABNAMRO: Thanks for reaching out. I believe our upcoming release, which will include this PR should include a Handle property to the RetryPolicy object that should give you the behavior you're looking for. Please let me know if I misunderstood.

In any case, I'm trying to kick off a release now, it will just take a bit longer as I'm having to re-build a bit of automation while we're at it. My hope is to get this release done in the next 2 weeks.

Should be out now: https://github.com/Azure/azure-functions-durable-extension/releases/tag/v1.1.6-worker-extension

Will be closing for now, please re-open if issues continue