Wanted to share a behavior that may not be that well known within the community. A very valued partner raised an issue with Microsoft that took us a while to understand what happened. A recurring job queue that is scheduled to run from 10:15 PM to 03:00 AM did only run two times. At the desired start time 22:15 and 23:15. After that, the job queue rescheduled itself to run again the next day from 22:15 and 23:15.
First of all, there's a limitation on the active background task a tenant can run simultaneously. As you probably know, Job Queues create background tasks.
Here's an example:
JQ A is scheduled to run at 00:00 and it runs for 3 hours (00:00 - 03:00)
JQ B is scheduled to run at 00:00 and it runs for 3 hours (00:30 - 03:30)
JQ C is scheduled to run at 01:00 and it runs for 3 hours (01:00 - 04:00)
So now between 01:00 and 03:00 there'll be 3 running JQs, so other JQ will start even if it's scheduled.
Say, JQ D is scheduled to run at 01:30. But it won't start at 01:30. It will start at ~03:00 when JQ A finishes and release a "slot".
In SaaS this is set to 3 which is the default setting in OnPrem environments as well:
Maximum number of scheduled tasks concurrently running.
-->
<add key="TaskSchedulerMaximumConcurrentRunningTasks" value="3" />
<!--
The Job Queue does not behave correctly if "Starting time" is after "Ending time". At some point this happens as per the schedule. The case when the timespan covers midnight isn't handled yet. However, the product group created repair items and added these to their backlog to improve Job Queue UI. The good news is that this is confirmed as undesired behavior and that this is something they would like to fix in future. The not so good news is that it does require a design change which cannot be handled as hot fix material / hot fix request to be raised via Microsoft CSS.
Hopefully this writing will help to understand the current behavior when you schedule the job queue to run pass through midnight.The workaround is easy to create the job queue to start at 0:15 AM to 04:00 AM as a sample.