0

I am trying to locally step through (using Visual Studio 2019) a Durable fuction, but when I invoke a call to context.CallActivityWithRetryAsync("MyActivity_Activity", retryOptions, myActivityParameters) from the OrchestrationTrigger, that invocation always returns the below:

Id = [xxxx], Status = WaitingForActivation, Method = "{null}", Result = "{Not yet computed}"

My first guess is there might be a deadlock somewhere, but I have rebooted my machine and still seeing the same result. Also, I tried setting a breakpoint at the first line of the activity (MyActivity_Activity), but that wasn't hit. Any help would be greatly appreciated!


Using the following:

  • VS 2019 Pro
  • .Net Core 2.2
  • Microsoft.Azure.DurableTask.AzureStorage v1.6.2
  • Microsoft.Azure.WebJobs.Extensions.DurableTask v1.8.2
  • Microsoft.NET.Sdk.Functions v1.0.29

    ...et al.

Below are some relevant snippets of code:

    [FunctionName("MyOrchestrator_HttpStart")]
public static async Task<HttpResponseMessage> HttpStart(
    [HttpTrigger(AuthorizationLevel.Function, "post")]HttpRequestMessage req,
    [OrchestrationClient]DurableOrchestrationClient starter, ExecutionContext executionContext)
{
    string instanceId = string.Empty;
    MyOrchestratorParameters myOrchestratorParameters = await req.Content.ReadAsAsync<MyOrchestratorParameters>();

    instanceId = await starter.StartNewAsync("MyOrchestrator", myOrchestratorParameters);

    return starter.CreateCheckStatusResponse(req, instanceId);
}



   [FunctionName("MyOrchestrator")]
    public static async Task RunOrchestrator(
        [OrchestrationTrigger] DurableOrchestrationContext context, 
         ExecutionContext executionContext)
    {
        MyOrchestratorParameters myOrchestratorParameters = 
           context.GetInput<MyOrchestratorParameters>();
           ValidateParameters(myOrchestratorParameters);

        var delay = 3000;
        var retry = 3;
        var retryOptions = new 
            RetryOptions(TimeSpan.FromSeconds(delay), retry);        

        MyActivityParameters myActivityParameters = new 
        MyActivityParameters()
        {
            JobNumber = myOrchestratorParameters.JobNumber,
            Stage = myOrchestratorParameters.Stage,
            TemplateId = myOrchestratorParameters.TemplateId
        };
        myActivityResults = 
            context.CallActivityWithRetryAsync<MyActivityResult> 
            ("MyActivity_Activity", retryOptions, myActivityParameters);    

        ...
    }


[FunctionName("MyActivity_Activity")]
public static async Task<MyActivityResult> 
   RunActivity([ActivityTrigger] DurableActivityContext 
   activityContext, ExecutionContext executionContext)
{
    var _myActivityParameters = 
       activityContext.GetInput<MyActivityParameters>();

    //do some stuff & return MyActivityResult object
}   

1 Answers1

0

I think I found the answer. In my calls to CallActivityWithRetryAsync, I needed to predicate that with an await. Once I did this, it started working!