Timer trigger firing multiple times

Adam Day 46 Reputation points Microsoft Employee
2023-11-28T17:13:24.73+00:00

Hello, our time trigger is firing multiple times.

first

Executing 'WorkItemEMailNotifier.SendNotificationsAsync' (Reason='Timer fired at 2023-11-27T06:30:00.6130744+00:00', Id=1b8ea6f5-4fbd-48f9-9cd3-bef1a60ffe96)

cloud_RoleInstance

f0077431910fb6dea54963132eadf2a2b43ec72473ce6346f6fc7962f841ea80

I think that id is the invocation id?


second

Executing 'WorkItemEMailNotifier.SendNotificationsAsync' (Reason='Timer fired at 2023-11-27T07:12:39.7954045+00:00', Id=eceebd57-9a4c-4a16-b9c2-004535d73526)

cloud_RoleInstance

03b1956e540c7298eb7ea1dd3fe97bd73e508a1d418997c00ed4bd3df4054cdc

Trigger Details: UnscheduledInvocationReason: IsPastDue, OriginalSchedule: 2023-11-27T06:30:00.0000000+00:00


third

Executing 'WorkItemEMailNotifier.SendNotificationsAsync' (Reason='Timer fired at 2023-11-27T07:36:52.7149523+00:00', Id=9be103dd-1af8-4c8d-9b52-620e38a0dac6)

cloud_RoleInstance

1357526e1782d62b35eb99cb2b065bf74fce4febbb54db61f298b49f3f9023a0

Trigger Details: UnscheduledInvocationReason: IsPastDue, OriginalSchedule: 2023-11-27T06:30:00.0000000+00:00


I see the cloud_RoleInstance is diefferent every time, so is it firing off of new instances spun up or something?

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

2 answers

Sort by: Most helpful
  1. Mike Urnun 9,781 Reputation points Microsoft Employee
    2023-11-29T23:45:17.37+00:00

    Hi @Adam Day - These may not be the same trigger event from multiple instances as the following is stated on the matter:

    The timer trigger uses a storage lock to ensure that there is only one timer instance when a function app scales out to multiple instances. If two function apps share the same identifying configuration and each uses a timer trigger, only one timer runs.

    Rather, they seem like executions from missed invocations:

    The isPastDue property is true when the current function invocation is later than scheduled. For example, a function app restart might cause an invocation to be missed.

    You might check why the invocations were missed (whether they originate from transient, non-blocking cause vs persistent issue that needs to be mitigated) and leverage the isPastDue flag for gracefully handling the scenario in your code. Hope this helps!


    Please "Accept Answer" if the answer is helpful so that others in the community may benefit from your experience.

    0 comments No comments