cron.yaml: is there a max limit to min_backoff_seconds?

42 views
Skip to first unread message

Mark Meyer

unread,
Nov 28, 2018, 9:06:07 PM11/28/18
to Google App Engine
I am using the following cron.yaml file and attempting to have the retries start at 2 minutes after a failure (I'm using Python3 in the standard environment).

cron:
- description: "daily call"
url: /twilio/start_call/
timezone: "America/Anchorage"
schedule: every day 17:00
retry_parameters:
min_backoff_seconds: 120.0
max_backoff_seconds: 360.0
max_doublings: 3


The behavior I'm expecting when the url returns 503 is a 120 second interval and then a retry. What I am getting retries at (quite precise) one minute intervals. I don't see anything in the docs about a time limit. I hope I'm not doing something obviously wrong, but I've been starting at it and trying variations without any success.

The logs I am see look like:

2018-11-26 17:00:00.764 AKST GET 503 178 B 970 ms AppEngine-Google (+http://code.google.com/appengine) /twilio/start_call/
2018-11-26 17:01:01.939 AKST GET 503 178 B 704 ms AppEngine-Google;(+http://code.google.com/appengine) /twilio/start_call/ 2018-11-26 17:02:02.747 AKST GET 503 178 B 850 ms AppEngine-Google;(+http://code.google.com/appengine) /twilio/start_call/ 2018-11-26 17:03:03.702 AKST GET 503 178 B 666 ms AppEngine-Google;(+http://code.google.com/appengine) /twilio/start_call/ 2018-11-26 17:04:04.477 AKST GET 200 189 B 65 ms AppEngine-Google; (+http://code.google.com/appengine) /twilio/start_call/

Is there something I'm missing?

Thank you.

George (Cloud Platform Support)

unread,
Nov 29, 2018, 4:07:07 PM11/29/18
to Google App Engine
Hello Mark, 

Your minimum retry interval for Cron is set to 2 minutes, and I have the feeling this is quite high, without any reasonable explanation to support my intuition. The expected value seems to be in the order of seconds. Three repeats for would imply 4 minute, 8 and then 16 minutes: quite a long time. What happens if you set the value of min_backoff_seconds to a few seconds, rather than a minute? It would be of interest to see if your value of min_backoff_seconds is then taken into consideration, or the minute repeat interval will be seen again in logs.  

If you'd like us to take a closer look at your issue, a copy of your app's code and Cron-related detail, together with relevant instructions is needed, in view of local reproduction of the error. This is better submitted by means of a similar issue in the Public Issue Tracker. This way, confidential details such as project ID can be safely transmitted, and you should be able to follow developments and solutions in the same thread. 

Bart Hazer

unread,
Nov 29, 2018, 8:26:41 PM11/29/18
to Google App Engine
Hi Mark - Responses with HTTP status 503 are a bit of a special case that is not documented very well. Those are retried every minute regardless of your retry_parameters. Retries for responses with all other non-200 status codes are governed by the specified retry_parameters. That is alluded to somewhat here: https://cloud.google.com/appengine/docs/standard/python/config/cron#retrying_cron_jobs_that_fail

Mark Meyer

unread,
Nov 30, 2018, 9:31:37 AM11/30/18
to Google App Engine
Bart, thank you! That was it. Some how I misread the docs and to mean you needed to send a 503. On re-reading it, that's obviously not what it says. I appreciate the help.
Reply all
Reply to author
Forward
0 new messages