locked
Do we get Concurrent issues in Azure time trigger function and retry option in activity functions? RRS feed

  • Question

  • Consider the following code, where my time trigger function runs for every minute. When Orchestrator Function(i.e RunOrchestrator) is started and it calls activity function("FhaDate") which throws argument exception. since I gave retry options while calling activity function when it fails for the first time. The activity function is retried 3 times by interval of 40 seconds.

    My Doubt is, at the time of executing activity functions for 3 attempts by keeping a time gap of 40 seconds, The new time trigger function is also triggered in meanwhile(since I gave it trigger for every 60 seconds), It will give any concurrent issues?

    [FunctionName("FHATimeTrigger")]
            public async Task RunAsync(
                                         [TimerTrigger("0 */1 * * * *")]TimerInfo myTimer, 
                                         [DurableClient]IDurableOrchestrationClient starter,
                                         ExecutionContext context, ILogger log
                                      )
            {
                    _logger.LogInformation($"C# Timer trigger function executed at: {DateTime.Now}");
    
                    string instanceId = await starter.StartNewAsync(orchestratorFunctionName: "FHATimeTriggerOrchestrator");
                    log.LogInformation($"Started Orchestrator {instanceId}");
            }

           [FunctionName("FHATimeTriggerOrchestrator")]
            public async Task RunOrchestrator([OrchestrationTrigger] IDurableOrchestrationContext context, ILogger log)
            {
    
                             var retryOptions = new RetryOptions(
                                       firstRetryInterval: TimeSpan.FromSeconds(40),
                                       maxNumberOfAttempts: 3);
                 List<string> a=   await 
                                 context.CallActivityWithRetryAsync<List<string("FhaDate",retryOptions,null);
             }

           [FunctionName("FhaDate")]
            public async Task<List<string>> Date([ActivityTrigger] ILogger<FHATimeTrigger> log)
            {
    
                    throw new ArgumentException("Server is down");
            }

    Please tell me the correct flow, as I am new to durable functions.

    Thanks in advance

    Friday, June 12, 2020 3:48 PM

All replies

  • Azure related questions are not supported on this forum. Better to post it on Microsoft QnA forum

    Ask a Question - Microsoft Q&A


    If the response helped, do "Mark as answer" and upvote it
    - Vaibhav

    Saturday, June 13, 2020 4:01 PM