Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Azure Scheduled WebJob started if previous one is still running?

I have a Scheduled Azure WebJob which runs every 5 mins. It's not clear what happens if the running times takes 10 mins. Is a new one started parallel to the one still running, or is it not started until the previous one has finished?

like image 692
Adam Szabo Avatar asked Sep 29 '22 22:09

Adam Szabo


1 Answers

From this answer What happens when a scheduled WebJob runs for a long time :

As i understand it scheduled webjobs is just triggered webjobs that is run using Azure Scheduler, if you open Azure Scheduler in management portal you can see the webjobs and even configure them in more detail. (You can see the log too which would give you the simple answer to your question).

If you like to look at whats going on your scheduled webjob is run as a Triggered webjob by Kudu, if you look in the Kudu source you will see that a lockfile is created when a job is started, and if you try to start another job a ConflictException is thrown if there is already a lock file.

The Azure scheduler calls your job using a webhook that catches the ConflictException and gives you the "Error_WebJobAlreadyRunning" warning which will tell you: "Cannot start a new run since job is already running."

like image 69
Thomas Avatar answered Dec 31 '22 20:12

Thomas