How to increase Cloud Scheduler request timeout deadline?

两盒软妹~` 提交于 2020-03-05 04:14:28

问题


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?


回答1:


When we look at Cloud Scheduler, we see that when the time is reached to fire a job the request to fire that job may fail. At this point, the request will be retried based on the configuration of that job ... see:

https://cloud.google.com/sdk/gcloud/reference/beta/scheduler/jobs/create/http

Among these settings we find:

  • --max-backoff
  • --max-doublings
  • --max-retry-attempts
  • --max-retry-duration
  • --min-backoff

It seems that if we want to keep trying for a solid 10 minutes we might be able to specify:

  • --max-backoff: 0s
  • --max-doublings: 0
  • --max-retry-attempts: 0
  • --max-retry-duration: 10m
  • --min-backoff: 0s



回答2:


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



来源:https://stackoverflow.com/questions/55874201/how-to-increase-cloud-scheduler-request-timeout-deadline

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!