windows server enterprise sp2 task scheduler kicks off same task multiple times

we have a task that runs every 30 minutes to check for a file to import.

as you can see from the attachment, there are 4 instances of the task that start all at exactly the same time, with different correlation ID.
all but 1 of them fail with "task already running"

the end result is that only 1 task gets run and it runs at the right time.. but......

why does it kick off multiple tasks!!!
makes looking through the history tedious.
tia
task-scheduler.png
CASorterAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
rsimseeConnect With a Mentor Commented:
Well, when in doubt reboot it out is one of my favorite sayings...
0
 
rsimseeCommented:
I don't know what your task is doing, but do you have the auto kill after a specified amount of time option set?  Do you know for certain it's ending / stopping?
0
 
CASorterAuthor Commented:
it is running an import program, which parses and processes a text file.

yes the first task stops when it is finished.   the issue is that at the exact same time, it kicks off 3-4 of the same task
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
rsimseeCommented:
Well, the obvious question here is why is it launching multiple times at once.

Maybe it is finishing *too* quickly?  It's possible that if it starts at 2:30 and finishes in such a really short amount of time that it auto starts it again because it is still in the launch window.  Try adding a command to your file to waste some time.

If you're running a .cmd (batch) file, you can try adding a command to waste a few seconds.  There's not actual command to do this in stock cmdese but you can put something in like "ping 192.168.254.1 -n 1 -w 60000" which will basically sit and wait for 60 seconds while it tries to ping a non-existant ip address.  (This assumes you don't have a 192.168.254.1 somewhere on your network :) )
0
 
CASorterAuthor Commented:
it runs for 40-50 minutes.  And the switch to not start a new one if this is one is still running is turned on, but when it kickes in on the half hour...   it tries and start 3-5 more tasks, all of which fail because the first one is still running.

i am *thinking* that it might be that if i edit the task, it somehow keeps the previous version "live"....

i am thinking of deleting and re creating the task.
0
 
rsimseeCommented:
That's exactly what I was getting to in my first post...  If you have a task that runs for 40-50 mins, and you try to start it again in 30 mins, it's going to fail.  Of course, it only takes a very short time to realize that it has failed, so it finishes and returns while it is still in it's launch window, and so it tries to run it again, which also fails and returns.  It apparently can launch, fail, and return about 3-4 times before the launch window expires.

As far as not starting a new one if the current one is still running, I'm not familiar with that option, and from what you describe it doesn't sound like it's working - where do you have that set and what exactly is it called?

Again, I don't know your requirements as to how often your import file must be parsed, but I would try extending the restart time to a value you know won't overrun the run time of a parsing script and see if it runs as you expect.
0
 
CASorterAuthor Commented:
it is supposed to detect if the scheduled job is still running(see attached pic) and if it is, dont start a new one.   i EXPECT to see 1(ONE) failure of a start if it tries to run again while it the initial scheduled task is still running.

what i am seeing is 3-5 attempts to start a new task all at the exact same time.

it seems like it should detect or know that the task is already running before i even tries to start up another one.....
nonewstart.png
0
 
rsimseeCommented:
The 3-5 attempts is because of how fast it's happening.  If you have a task that is set to run at 2:30, and it starts, fails, and returns in 15 seconds, it is *still* 2:30 when it comes back to task scheduler, so task scheduler will start it again.  It will continue to do this until 2:31:

2:30.0     Runs Task - Fails
2:30.15   Runs Task - Fails
2:30.30   Runs Task - Fails
2:30.45   Runs Task - Fails
2:31.0     Out of Launch Window

Perhaps the system is not detecting the task is still running because you have kicked off another process in your task, and the initial process is completed in time?

Either way, you can extend the relaunch time, or, if you are ok with the 1 failure but not 3-5, you can put a statement in your event that waits 1 minute before returning.  If you're using a .cmd file you can do something like "Ping 192.168.254.1 -n 1 -w 600000" which will make it count to 60 before ending.
0
 
CASorterAuthor Commented:
not buying it.

the first run, it should start.  period.  

your scenario isnt quite right.

this is what happens
2:30.0     Runs Task - starts successfully  and will keep running for 40 minutes or more.
2:30.0  tries to start another instance of the same task - Fails because instance 1 is running successfully
2:30.0  tries to start  another instance of the same task - Fails because instance 1 is running successfully
2:30.0  tries to start  another instance of the same task - Fails because instance 1 is running successfully

3:00 tries to start task - Fails because instance 1 is running successfully
3:00 tries to start task - Fails because instance 1 is running successfully
3:00 tries to start task - Fails because instance 1 is running successfully
3:00 tries to start task - Fails because instance 1 is running successfully

3:30 tries to start task - Fails because instance 1 is running successfully
3:30 tries to start task - Fails because instance 1 is running successfully
3:30 tries to start task - Fails because instance 1 is running successfully
3:30 tries to start task - Fails because instance 1 is running successfully

3:33 task finishes.


this is what i would expect to happen

2:30.0     Runs Task - starts successfully  and will keep running for 40 minutes or more.

3:00 tries to start task - Fails because instance 1 is running successfully

3:30 tries to start task - Fails because instance 1 is running successfully

3:33 task finishes.
0
 
rsimseeCommented:
What is the format of your task?  (cmd or an executable?)
0
 
CASorterAuthor Commented:
an executable   .exe
0
 
CASorterAuthor Commented:
... and on top of all that..   now none of the history is showing at all in the history tab.  

the jobs are all still running, but the history is not showing.

more specifically,    the history stopped being updated.   the old history records are there, i can see them..  

just no new ones are being added.  for ANY jobs in the list

but the jobs are running




gaaarrrr
0
 
rsimseeCommented:
Just as a test, make a .cmd file and replace the .exe file with it....

ping 192.168.254.1 -n 1 -w 60000
<your exe file>

See if it gets rid of the duplicate runs.
0
 
CASorterAuthor Commented:
... i cant tell if it works now because NONE of the history records are showing.


i will try it when we reboot the server.
(which *might* fix the problem anyway)
0
 
CASorterAuthor Commented:
question 1 with trouble shooting

Is it plugged in?

question 2

have  you rebooted?

i will keep you posted.
0
 
CASorterAuthor Commented:
after reboot.   it is still doing it.

i am not that concerned, because the result is what is desired.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.