4 Replies Latest reply: Mar 18, 2016 2:02 PM by Jessica Tung RSS

    Task Execution Option

    Jessica Tung

      Hi I have a task usually runs less than 1 minute. I set the Task Execution Options as 2 and Timeout in minutes as 1. My intention was if the task runs over 1 minute and fails, then run again twice until it completes successfully. However it didn't work out as what I expected, what does this work out? Thanks.

        • Re: Task Execution Option
          Peter Cammaert

          Woops, you may have to take into account that loading and starting a task as well as distributing the document, closing down and cleaning up will have a setup cost outside of the actual runtime of the script. Therefor, a single minute (which may not even amount to 60 seconds) may be a bit short.

           

          Moreover, a timeout of 1 minute will effectively kill your task, maybe even before it was halfway though the load script. And how would the second attempt improve on this situation? It will probably fail again after the exact same runtime.

           

          To know exactly how much time a task requires to run until completion, disable all timeouts, let a task run all the way till the end and check the task execution log in QMC or the TaskLog.txt file. The timestamps of the first and the last log entry will give you a good idea of the minimum delay. Then do add a safety margin  

            • Re: Task Execution Option
              Jessica Tung

              Hi Peter, thank you, you had a good point. I set the timeout time to 3 minutes, and the task failed with run time 1 minute 4 sec, but it still didn't re-try, why is that? 

                • Re: Task Execution Option
                  Peter Cammaert

                  This 1 minute 4 seconds, is that the script run time? Or is it the total task execution time from the TaskLog?

                   

                  Also note that in QMC the task Timeout value (next to the Retries field) is the maximum allowed duration for all retries together. 3 minutes may be even too short for two runs. Maybe you should set the Timeout value to 5 minutes?

                   

                  Peter

                    • Re: Task Execution Option
                      Jessica Tung

                      Ah, that's the answer! "Also note that in QMC the task Timeout value (next to the Retries field) is the maximum allowed duration for all retries together."
                      I always thought the timeout value is task reload time, i.e. if it's over a certain minutes then reload. I set the timevalue longer and it worked! I guess I have to use sleep(seconds) together to make the re-try wait. Please correct me if I am wrong. Thanks!