I have a scheduled task that is configured to be killed 23 hours after starting. When I export the task to XML I can verify this setting because I see the line:
However, the task is actually being killed after 20 hours.
The task starts at 6PM every day. Looking at the task history, I see that TaskScheduler terminated the task "due to timeout reached" at 2:00:01PM the following day. Of course it should have terminated at 5PM if it did not finish before then on its own.
How can I make the change in setting really take effect?
I tried exporting the task to XML, then deleting it, and reimporting from XML. This did not work, for one thing, the history tab still shows all the old events for the (deleted) task; it's like it was not fully deleted.
I also just disabled the task and reimported it from XML under another name. That new task also failed after 20 hours. Setting the interval to 24 hours (to see if it is killed after 21) does not work, it still terminates after 20 hours. Similarly setting the timeout to the equivalent number of seconds (to 23 hours) also times out after 20 hours.
This is on windows server 2008 R2 Enterprise Service Pack 1. This seems like a serious bug. Unfortunately, upgrading to server 2012 is not an option in the short term.
Here is the task definition exported to XML (yes, those funny characters at the beginning were there in the original). In this case I had set the timeout to 1435 minutes and it is rendered below as 23 hours and 55 minutes.
��<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<Arguments>>> e:\biocbld\bbs-3.3-bioc\log\MOSCATO2.log 2>&1</Arguments>