Hello,
We've been using this API to manage scheduled tasks (mostly by enabling them and disabling them) on a number of remote servers during software deployments, and it works quite well the majority of the time.
Occasionally, however, we run into a situation where a scheduled task gets "hung" (remains in a "Running" state perpetually, even though it's not actually doing any work). This happens most often on servers with slower connections, although it happens on faster servers as well with a decreased regularity.
I've been able to recreate the situation relatively easily by creating the conditions outlined here:
http://blogs.technet.com/b/rspitz/archive/2010/11/07/scheduled-tasks-appear-hung-in-the-running-state-on-windows-server-2003-based-systems.aspx
While in this state, we can't stop the task (either through the Task.Stop() API call or through the Windows Scheduled Task interface) and are forced to restart the Task Scheduler service to free it up.
Since the Windows interface doesn't seem to allow us to stop tasks in this condition I don't have much hope for the API, but I have to ask: Has anyone here encountered this before and found a way to deal with it and/or avoid it when using this API?
We've been using this API to manage scheduled tasks (mostly by enabling them and disabling them) on a number of remote servers during software deployments, and it works quite well the majority of the time.
Occasionally, however, we run into a situation where a scheduled task gets "hung" (remains in a "Running" state perpetually, even though it's not actually doing any work). This happens most often on servers with slower connections, although it happens on faster servers as well with a decreased regularity.
I've been able to recreate the situation relatively easily by creating the conditions outlined here:
http://blogs.technet.com/b/rspitz/archive/2010/11/07/scheduled-tasks-appear-hung-in-the-running-state-on-windows-server-2003-based-systems.aspx
While in this state, we can't stop the task (either through the Task.Stop() API call or through the Windows Scheduled Task interface) and are forced to restart the Task Scheduler service to free it up.
Since the Windows interface doesn't seem to allow us to stop tasks in this condition I don't have much hope for the API, but I have to ask: Has anyone here encountered this before and found a way to deal with it and/or avoid it when using this API?