Cloud run seems to timeout and generate HTTP 304 responses for application endpoints that don’t check last modified headers or other etags

  Kiến thức lập trình

I have a Rails application on cloud run with an endpoint called by our apps to determine if their version is current and if not, requires a download. This is a simple, one record read of the database in a table of less than one hundred records and the vast majority of the time the endpoint returns in a few milliseconds. According to the logs most of the time the records is read form SQL cache and the SQL query and system insights never show any load or locks on the DB.

For some reason this endpoint and a few others occasionally return an HTTP 304 response after 20 to 25 seconds (!). I never see any attempt to access the database ( or anything else ) by the code in these cases. Simply a one line entry in the log of a GET with an absurdly large response time.

I’m expecting a normal sub-second response

New contributor

Daniel McCarty is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT