4

I have created an http cloud scheduler task. I'm expecting it to have a maximum run time of 5 minutes. However my task is reporting DEADLINE_EXCEEDED after exactly 1 minute.

When I run gcloud scheduler jobs describe MySyncTask to view my task it reports attemptDeadline: 300s. The service I am calling is cloud run and I have also set a 300s limit.

I am running the task manually by clicking "force a job run" in the GUI.

After 1 minute exactly in the logs it reports DEADLINE_EXCEEDED

deadline after 1 minute

Taylor j. Eke
  • 255
  • 1
  • 3
  • 9
  • After waiting for my scheduled task to run at it's scheduled time I can confirm it does work. There seems to be a glitch in cloud scheduler where a task will not respect it's deadline setting when forced to run immediately. – Taylor j. Eke Jul 05 '22 at 17:00
  • Did you have a chance to check out my [answer](https://stackoverflow.com/a/72875530/13171940)? – Rogelio Monter Jul 11 '22 at 22:16

1 Answers1

3

When you execute a job from the GUI, it will be executed using the default attemptDeadline value, which is 60 seconds according to this question.

If you want to run it manually, I suggest to run the job from the Cloud Shell and pass the --attempt-deadline flag with the desired value, as shown on this answer:

gcloud beta scheduler jobs update http <job> --attempt-deadline=1800s --project <project>
Rogelio Monter
  • 1,084
  • 7
  • 18