Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to increase Cloud Scheduler request timeout deadline?

I want to migrate from App Engine Cron jobs to Cloud Scheduler, but in Cloud Scheduler the request deadline timeout is 60 seconds, not the 10 minutes that has the requests from Cron jobs.

Is there a way to configure Cloud Scheduler App Engine request's to have a deadline timeout of 10 minutes?

like image 353
Rony Bichler Avatar asked Apr 26 '19 19:04

Rony Bichler


People also ask

Does Cloud Scheduler need App Engine?

If you are going to use an App Engine HTTP target, your project must have an App Engine app. This app serves as both the location of the Cloud Scheduler service and of the handler itself. If you wish to have an App Engine handler that is not in your project, you should select an HTTP target instead.


2 Answers

This will set the deadline for a job to 30mins. Which is the max for HTTP targets.

gcloud beta scheduler jobs update http <job> --attempt-deadline=1800s --project <project>

The allowed duration for this deadline is: For HTTP targets, between 15 seconds and 30 minutes. For App Engine HTTP targets, between 15 seconds and 24 hours. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".

Source: https://cloud.google.com/scheduler/docs/reference/rest/v1/projects.locations.jobs#Job

like image 136
mattes Avatar answered Nov 15 '22 08:11

mattes


According to their scheduler.v1beta1, it is possible to set that Deadline using the attemptDeadline.

The deadline for job attempts. If the request handler does not respond by this deadline then the request is cancelled and the attempt is marked as a DEADLINE_EXCEEDED failure. The failed attempt can be viewed in execution logs. Cloud Scheduler will retry the job according to the RetryConfig.

The allowed duration for this deadline is:

For HTTP targets, between 15 seconds and 30 minutes. For App Engine HTTP targets, between 15 seconds and 24 hours. For PubSub targets, this field is ignored.

https://cloud.google.com/nodejs/docs/reference/scheduler/0.3.x/google.cloud.scheduler.v1beta1#.Job

like image 25
Sebastián Lozada Avatar answered Nov 15 '22 08:11

Sebastián Lozada