Page 1 of 1
TI Process Execution Time out
Posted: Wed Jan 23, 2013 8:21 pm
by ExApplix
Hi,
I know a TI Process can be manually killed using TM1Top. But I am looking for a functionality/workaround by which we can kill (cancel execution) a TI process if it has not finished execution after a certain period of time.
Any ideas/suggestions will be highly appreciated.
Re: TI Process Execution Time out
Posted: Wed Jan 23, 2013 8:40 pm
by Steve Rowe
Not sure if this approach is what you are after but...
1. Capture the start time when the TI launches.
2. Define the maximum run time of the TI.
3. Periodically test the elapsed run time of the TI in the TI and process break / quit if the run time in 2 has been exceeded.
If what you are looking for is something to automatically kill of "hung" TIs after a period of time then I can't help.
Cheers,
Re: TI Process Execution Time out
Posted: Wed Jan 23, 2013 9:00 pm
by lotsaram
Steve Rowe wrote:Not sure if this approach is what you are after but...
1. Capture the start time when the TI launches.
2. Define the maximum run time of the TI.
3. Periodically test the elapsed run time of the TI in the TI and process break / quit if the run time in 2 has been exceeded.
If what you are looking for is something to automatically kill of "hung" TIs after a period of time then I can't help.
Cheers,
I like that idea. To kill a process "on demand" you could do a variation and have the process periodically check a directory for a specific file and if it exists then process break or quit. Should do the trick give or take a few seconds.
Re: TI Process Execution Time out
Posted: Wed Jan 23, 2013 9:51 pm
by ExApplix
Steve Rowe wrote:Not sure if this approach is what you are after but...
1. Capture the start time when the TI launches.
2. Define the maximum run time of the TI.
3. Periodically test the elapsed run time of the TI in the TI and process break / quit if the run time in 2 has been exceeded.
Yes, this is something which I want to do. But I need bit more help.
How can we capture the start time of a TI? Is it by reading tm1server.log?
How to find the elapsed time of a TI?
Re: TI Process Execution Time out
Posted: Wed Jan 23, 2013 10:13 pm
by Alan Kirk
ExApplix wrote:Steve Rowe wrote:Not sure if this approach is what you are after but...
1. Capture the start time when the TI launches.
2. Define the maximum run time of the TI.
3. Periodically test the elapsed run time of the TI in the TI and process break / quit if the run time in 2 has been exceeded.
Yes, this is something which I want to do. But I need bit more help.
How can we capture the start time of a TI? Is it by reading tm1server.log?
Too complicated. Grab the start time and store it in a variable. See
here for a rundown on all date and time functions. (Hint: Now() is what you want, typically assigned to a variable that you define in the Prolog.)
ExApplix wrote:How to find the elapsed time of a TI?
Call the same function again. Compare it to the variable that you assigned earlier. If it exceeds the limit that you've set, quit.
I had started to type out something similar to Steve's reply but left it aside because there are two complicating factors. One Steve mentioned; if for instance the thing has hung on an ODBC connection, this approach won't help you.
The other is one that you have to figure out for yourself; if you DO quit the process, is there any clean-up that you'll have to do? For instance, if you quit when only half of a data load has been done, do you need to roll back? You'll have to figure that one out for yourself depending on what the process is intended to do.