2

Let's assume we have two scheduled tasks, both with the option Run task as soon as possible after a scheduled start is missed toggled on.

These tasks are conflicting. In this case, one of them turns off service.exe, and one of them an hour later turns it back on.

Assuming there is an issue, for example the server is entirely offline during this window (hopefully not!), it isn't important that service.exe is off during this window. However, it is dreadfully important that service.exe is on going forward from this window.

My fear is that, if both tasks trigger having neither been triggered previously, they will trigger in an order that taking the service offline will happen second, and thus service.exe will not be running during production time.

Will missed scheduled tasks run in chronological order? If not, how is the order of missed scheduled starts decided?

nostalgk
  • 165
  • 5
  • 3
    why don't you just test it? :-) local VM or something? – frupfrup Feb 01 '19 at 14:15
  • @frupfrup Of course, it's on the agenda, but I wanted to ask the knowledgeable folks of serverfault before I possibly applied misattributive bias to a solution on a production machine. Windows has been known to deceive me with its behavior... – nostalgk Feb 01 '19 at 14:21
  • Plus, it'd be great if someone had some evidence for the documentation of expected behavior, as I cannot seem to find any. – nostalgk Feb 01 '19 at 14:22

1 Answers1

4

The order is not specified, it's an implementation detail. So you can't rely on the execution order, because it can be random, or change with Windows updates.

You have two options here:

  • Disable Run task as soon as possible after a scheduled start is missed on the task that stops the service.

OR

  • Create one scheduled tasks with multiple actions. The order of execution of the actions within a task is followed.
Swisstone
  • 6,725
  • 7
  • 22
  • 32