Cloud Run just start halt and start responding 504

I've been running a service on Cloud Run for a while. A few days ago, the service started freezing randomly, about 2 to 3 times a day. Basically, it begins responding with 504 for all requests and only returns when I restart the container. I noticed that it 'crashes' at some point, and when it comes back up, all requests start responding with 504. The service is built in Flask. I have no logging information so I cannot figure out what is going on.

Se picture below the latency starts to going up until 5 min, And all requests responds 504.

pedrorjbr_1-1712836763979.png

 



pedrorjbr_0-1712836676615.png

 

5 3 158
3 REPLIES 3

Hello @pedrorjbr,

Welcome to the Google Cloud Community!

Since you don't have logging information, start by setting up and integrating logging. You can find a guide on StackOverflow here.

Cloud Run has a default timeout of 5 minutes , which can be extended to 60 minutes. If your application typically takes longer to respond, try adjusting the timeout settings to see if it helps.

Also, ensure that you allocate at least one minimum instance for your Cloud Run service. This prevents delays in scaling up containers when demand increases.

If logging doesn't identify any issues, consider contacting our Google Cloud Support to further investigate the problem.

It seens there is a report bug on that: https://github.com/googleapis/python-pubsub/issues/1101
It seem so simple use case. Is there any workaround? other library?