At work we have bunch of automated scripts running on one of the servers. Most are either batch scripts or PHP scripts that are triggered at various intervals sending out automatic email notifications, or some important business stats to the directors. Few people complained to me that they stopped receiving some of the emails sometime last week.
When I peeked at the Windows Task Scheduler on the server, I noticed that several of the tasks had their status listed as Running. This was obviously an issue, because most of these scripts only require fraction of a second to execute. Furthermore, right clicking affected items and choosing End Task produced absolutely no effect. Something went very wrong here.
I really did not want to reboot the whole machine for a stupid little issue like that so I started poking around trying to find the rogue processes. Unfortunately, the scripts themselves must have finished running long time ago and they did not appear in the task manager. It was not the scripts but the actual scheduler threads that launched them seem to have hung themselves.
Fortunately, I found out that restarting the task scheduler service did the trick. You can actually do this from the Scheduled Tasks window. Simply go to Advanced on your toolbar and choose Stop Using Task Scheduler. Then go back and click Start Using Task Scheduler again. If the window does not refresh automatically, just reload it manually. The status on the hung tasks should clear themselves.
I’m not sure what caused this to happen. I will keep my eye on the server to see if it does it again. It could be a number of things – for example the scripts themselves may be doing something strange. But on the other hand they were working for several weeks now without any issues, so go figure.
[tags]windows, windows task scheduler, task scheduler, scheduled tasks, running tasks, servicesp[/tags]