0

I have Azure Function using .NET Core 3.1\C# I am trying to use retry policy. See below code for the function:

using System;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Host;
using Microsoft.Extensions.Logging;

namespace DevFunctionApp
{
public class Function1
{
    private static int _counter = 0;

    public Function1() { }

    [FunctionName("Function1")]
    [FixedDelayRetry(5, "00:01:00")] // delayInterval = 1 minute
    public void Run([TimerTrigger("0 */10 * * * *")] TimerInfo myTimer, ILogger log) // it runs every 10 minutes
    {
        log.LogInformation($"C# Timer trigger function executed at: {DateTime.Now}");

        throw new System.Exception("Azure Function Rety Exception");
    }
}
}

When Function fails retry logic works correctly for the first, second and third retry but for last two fourth and fifth it fires them at the same time. See log below:

enter image description here

Doesn't matter how many retries or time interval set it always fires last two retries at the same time.

Question: How to fix the issue of last two retries firing at the same time?

Farukh
  • 2,173
  • 2
  • 23
  • 38
  • 2
    Can't see anything wrong with the code. Feature is in preview, their released stuff if pretty shaky, so preview would really be very questionable. [Check github](https://github.com/Azure/azure-functions-host/issues) if there is a known issue, if not file one. – Kashyap Mar 12 '21 at 21:22

0 Answers0