1
votes

GCP documentation says the max runtime a cloud run container can be 60 min (Timeouts greater than 15 minutes are a Beta feature.) Now, one of the way to trigger cloud run is via pub-sub push subscription. However, GCP documentation says a pub-sub push subscription can have maximum ack deadline of 10 minutes.

Now, my cloud run container is taking 15 minutes to finish. And after 10 minutes of container start, push subscription misses the ack deadline and topic re-publishes the message due to which another instance of cloud run is created. And this keep goes on in infinite loop.

Can anyone suggest what can be done here?

2
If a job/task takes longer than the Pub/Sub timeout then redesign the requirements/objectives/services. Use Google Cloud Tasks to manage long running jobs. Pub/Sub is not meant to be a job manager. cloud.google.com/tasks - John Hanley

2 Answers

2
votes

TL;DR: use another product that have longer timeout, such as Cloud Task or Workflows. 30 minutes max each.

If you need more, I have a strange idea. But let me know if already enough or not!


For the small story, I was involved in the alpha about the 60 minutes timeout. And my first question was: How can I test it? I don't want to create a VM for this!

So, the serverless team at Google are aware about the issue, and they promised improvements on several products. End of story, I haven't more inputs on what next and when!

0
votes

I discovered that the Official Python client will automatically extend the acknowledgment time out as long as the tcp connection is open. but I don't know how long it will maintain that so I'll have to test it out myself, cause perhaps the client has a timeout as well. I also don't know on any of the other official client implementations for other languages. And you can use Anthos for longer cloud run times up to 24 hour's I believe.