Timer triggered functions not firing or firing past due

Tran, Nguyen 20 Reputation points
2024-07-12T18:12:27.2566667+00:00

Hello all,

We currently have two timer triggered functions that either don't get triggered at all or get triggered past due. Of course, we want these functions to trigger and trigger on time.

For example, here's one of our functions that's scheduled to run daily at 12am CST time zone in Texas (we now changed it to trigger daily at 11am):

User's image

We can see that, when the function first got deployed (6/15) until 6/18, it got triggered daily and rather on time. Then from 6/19 to 6/25, it got triggered daily but was past due. Then from 6/28 onwards, it no longer gets triggered daily, and when it gets triggered it's due to "Trigger Details: UnscheduledInvocationReason: IsPastDue"

Here's the info about our function app for further context:

  1. Our function app uses In-process C# and is on Premium Plan
  2. We deploy our functions to the function app via GITHUB_ZIP_DEPLOY_FUNCTIONS_V1
  3. WEBSITE_TIME_ZONE = Central Standard Time
  4. I set this function's CRON expression as "0 0 11 * * *" and expect it to run daily at 11am CST.
  5. Sample invocation id to find our function app: "Executing 'LoadPeopleEmployeeAllAA' (Reason='Timer fired at 2024-07-11T15:07:09.7613018-05:00', Id=f51a0277-9233-4105-81be-7cd5ee463af5)"

Please provide us guidance on how to resolve this. I'm also wondering it has something to do with some logging issue, or the timer triggers are not 'synced up' properly.

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

2 answers

Sort by: Most helpful
  1. Sander van de Velde | MVP 32,726 Reputation points MVP
    2024-07-14T11:45:24.28+00:00

    Hello @Tran, Nguyen,

    welcome to this moderated Azure community forum.

    Timer triggered Azure Functions are great to execute code at certain points in time.

    The underlying schedular act like a singleton and cannot run two timer triggered functions at once by default.

    Check out this blog post for the background story.

    This seems to be fixable by adding the ‘UseMonitor = false’ parameter.


    If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. All community members with similar issues will benefit by doing so. Your contribution is highly appreciated.


  2. Tran, Nguyen 20 Reputation points
    2024-07-16T17:03:00.8633333+00:00

    SOLUTION:

    Seemingly, our function code is not efficient enough for EP1 plan and thus mid run, the JobHost restarts which then causes the function to never complete its on-time run due to “Thread Pool Starvation and high memory usage”

    Our fix for now is to upgrade the plan from EP1 to EP2 while optimizing the code to later switch back to EP1 to save on costs.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.