Solved

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

Posted on 2012-04-03
16
1,062 Views
Last Modified: 2012-05-15
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
0
Comment
Question by:CASorter
  • 9
  • 7
16 Comments
 
LVL 7

Expert Comment

by:rsimsee
Comment Utility
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
 

Author Comment

by:CASorter
Comment Utility
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
 
LVL 7

Expert Comment

by:rsimsee
Comment Utility
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
 

Author Comment

by:CASorter
Comment Utility
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
 
LVL 7

Expert Comment

by:rsimsee
Comment Utility
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
 

Author Comment

by:CASorter
Comment Utility
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
 
LVL 7

Expert Comment

by:rsimsee
Comment Utility
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
 

Author Comment

by:CASorter
Comment Utility
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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 7

Expert Comment

by:rsimsee
Comment Utility
What is the format of your task?  (cmd or an executable?)
0
 

Author Comment

by:CASorter
Comment Utility
an executable   .exe
0
 

Author Comment

by:CASorter
Comment Utility
... 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
 
LVL 7

Expert Comment

by:rsimsee
Comment Utility
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
 

Author Comment

by:CASorter
Comment Utility
... 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
 
LVL 7

Accepted Solution

by:
rsimsee earned 500 total points
Comment Utility
Well, when in doubt reboot it out is one of my favorite sayings...
0
 

Author Comment

by:CASorter
Comment Utility
question 1 with trouble shooting

Is it plugged in?

question 2

have  you rebooted?

i will keep you posted.
0
 

Author Comment

by:CASorter
Comment Utility
after reboot.   it is still doing it.

i am not that concerned, because the result is what is desired.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The way I use Experts Exchange to assist me in analyzing and diagnosing a problem is I first enter a Verbose Question at Experts Exchange like: Office 2007 will hang when opening and saving files I then launch WordPad (any text editor will do) an…
This is my 3rd article on SCCM in recent weeks, the 1st (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Server/Windows_Server_2008/A_4466-A-beginners-guide-to-installing-SCCM2007-on-Windows-2008-R2-Server.html) dealing with installat…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now