Scheduled Task is being run multiple times at once

C

CoolDadTx

We have recently migrated from our legacy Server 2008 R2 server to Server 2016 with the latest updates as of Nov. We run a lot of scheduled tasks that run various times of day - some fixed, some on an interval.

We have 3 environments (dev, QA, Prod) and 3 identically configured servers except memory. On all these new servers we are seeing Task Scheduler try to run our interval tasks multiple times at once. It doesn't seem to have an issue for tasks that run at a fixed time. For example we have a job that runs every minute. Whenever the job triggers it takes about 8 seconds to run. In the task history we can see that at the point Scheduler started the task it tried to run it twice or more. We have the tasks configured to not start again if there is an instance still running so in the task history we can see the task start and then immediately we see a warning "Launch request ignored, instance already running". Why is it trying to run the task multiple times? Note that the history shows the same correlation Id for all the instances it tried to run during this timeframe. Each minute a new correlation ID is generated for the new task that is started but then a couple of warnings (with the same correlation ID) stating it is already running.

1514036.png

Some info about these new servers. We see this in all environments but the # of times it starts to run the task varies. In Dev it seems to have tried up to 8 times. The tasks were created by exporting from the old server and importing to the new server so the configuration is identical to our old environment. If it were a settings issue I would expect to see this issue on our old servers but they have never had this issue.

```xml

<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2019-09-18T13:08:20.2058346-05:00</Date>
<Author>Azure DevOps</Author>
<Description>Task Description</Description>
<URI>\Sample Task</URI>
</RegistrationInfo>
<Triggers>
<CalendarTrigger>
<Repetition>
<Interval>PT1M</Interval>
<StopAtDurationEnd>false</StopAtDurationEnd>
</Repetition>
<StartBoundary>2010-01-01T00:00:00</StartBoundary>
<ExecutionTimeLimit>PT1H</ExecutionTimeLimit>
<Enabled>true</Enabled>
<ScheduleByDay>
<DaysInterval>1</DaysInterval>
</ScheduleByDay>
</CalendarTrigger>
</Triggers>
<Settings>
<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
<DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
<StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
<AllowHardTerminate>true</AllowHardTerminate>
<StartWhenAvailable>false</StartWhenAvailable>
<RunOnlyIfNetworkAvailable>true</RunOnlyIfNetworkAvailable>
<IdleSettings>
<StopOnIdleEnd>true</StopOnIdleEnd>
<RestartOnIdle>false</RestartOnIdle>
</IdleSettings>
<AllowStartOnDemand>true</AllowStartOnDemand>
<Enabled>true</Enabled>
<Hidden>true</Hidden>
<RunOnlyIfIdle>false</RunOnlyIfIdle>
<WakeToRun>false</WakeToRun>
<ExecutionTimeLimit>PT1H</ExecutionTimeLimit>
<Priority>7</Priority>
</Settings>
<Actions Context="Author">
<Exec>
<Command>C:\windows\notepad.exe</Command>
</Exec>
</Actions>
</Task>

```

Note the program has been changed to protect the innocent.




Michael Taylor P3.NET – Programming pearls for .NET programming

Continue reading...
 

Similar threads

Back
Top Bottom