none
How to change the timeout for Azure Scheduler job?

    Question

  • Hi, I've just started using Azure Scheduler, but I've a problem that my web app needs sometimes more than 30 seconds for completing the maintenance request - the scheduled jobs are then ending with timeout errors.

    I use HTTP/GET request.

    Is there a way how to increase the timeout for the scheduled jobs?

    Thanks.


    Tuesday, December 17, 2013 3:59 PM

Answers

All replies

  • We didn't anticipate making this configurable, but want to understand what your needs are here.  Would 60 seconds be enough?  Allowing job executions to take an arbitrarily long time consumes resources on our side, so we definitely have to place an upper bound on an http action execution time.
    Tuesday, December 17, 2013 11:48 PM
  • I'm currently using the Scheduler for running daily integration tests of packages used in our WP8 and Windows 8 apps. Test of each package means downloading up to 100MB of data, extracting files and doing some integrity test of the data. The downloading itself can take up to minute or two, based on the package size (it's downloaded from another Azure virtual machine), the extraction is also not immediate.

    I think 60s timeout would definitely help and I also understand that longer timeout might consume your resources. I'd be probably interesting and motivating to introduce configurable timeout in the Standard payment plan, and keep max 60s in free plan, or something like that. Or maybe having "daily timeout buffer" in the free plan equal to max 24 hourly executions * 60s, that can be used dynamically?

    And also another option might configurable retry count for jobs. For instance I can imagine jobs where automatic retries are not wanted.

    Wednesday, December 18, 2013 7:14 AM
  • Thank you for the details on your use case, it helps us improve our service.  We're not certain which path to take yet.

    Regarding configurable retry: we presently offer a RetryPolicy (member of JobAction in the API), give it a try!

    Wednesday, December 18, 2013 5:54 PM
  • Just to add a little more information. As stated above, the retry feature is not available in the portal. But you can use it in the SDK. The SDK can be downloaded from here:

    Windows Azure Scheduler Management Library 0.9.6-preview

    http://www.nuget.org/packages/Microsoft.WindowsAzure.Management.Scheduler/

    Here is a sample on using the SDK

    A complete overview to get started with the Windows Azure Scheduler

    http://fabriccontroller.net/blog/posts/a-complete-overview-to-get-started-with-the-windows-azure-scheduler/

    In the sample above there is a Retry section. I will look something like this

            RetryPolicy = new RetryPolicy()
            {
                RetryCount = 5,
                RetryInterval = TimeSpan.FromMinutes(1),
                RetryType = RetryType.Fixed
            }


    Johnny Coleman [MSFT] Any code posted to this Forum is [As-Is] With No Warranties

    Wednesday, December 18, 2013 11:58 PM
    Owner
  • Thanks for the info about API.

    It would be definitely good to have the option top edit created Jobs in Azure Portal, including retry count, interval and type - right now there is only option to disable or delete such Job.

    And regarding those long running jobs - one solution could be some kind of flag when creating the Job that only request to the given Uri should be made, without waiting for the response, if the waiting time is longer than X seconds, something like "fire and forget".

    Timeouts in these long-running jobs should not be considered as errors. I've checked - even when Azure portal shows these timeouts as Errors, all those long running executions completed successfully on my server.

    Thursday, December 19, 2013 10:16 AM
  • I subscribe to the suggestion to have the option to edit jobs in Azure Portal. 

    Sunday, December 22, 2013 6:08 PM
  • Hi,

    I'm using Scheduler with a job making a Get request to a Web API action that triggers a long running call. API is implemented at Azure Website.

    I had a similar problem using Scheduler. every time Scheduler made a request it returned errors at the job and started retries. 

    After some time, on job start ( I imagine the 30 seconds as someone else mentioned in this thread) errors showed up.

    What inspired a solution to me was another comment here about the using a "fire and forget" strategy. My idea is not using it at Scheduler (through the API), but setting that strategy at the API code. What I did was to set the call to the method executed as asynchronous so no need to wait for its execution.

    I used this instruction to call asynchronously:

    Task.Factory.StartNew(() => MyMethodClass.MyStaticMethod(parameter));

    Cheers,

    Danfer Habed López.


    Dánfer Habed López

    Friday, January 31, 2014 7:54 PM
  • Hi Martin,

    I had an issue with the job's timeout too, even it finished ok, my problems were the retries, in my case it multiplied the times some data was to be created by the call executed through the job request.

    Cheers


    Dánfer Habed López

    Friday, January 31, 2014 7:57 PM
  • Would love to be able to do this.  I would also like to propose being able to invoke a scheduled job "ad hoc" outside of its schedule.

    I assume that for really long running jobs, we should probably just use the scheduler service to kick off a "web job" that's sitting on the WAWS machine, correct?

    Sunday, March 02, 2014 8:10 PM
  • We didn't anticipate making this configurable, but want to understand what your needs are here.  Would 60 seconds be enough?  Allowing job executions to take an arbitrarily long time consumes resources on our side, so we definitely have to place an upper bound on an http action execution time.
    Is this being worked on? I also would benefit from a longer timeout period.
    Wednesday, June 01, 2016 3:43 PM