Report #12742
[gotcha] HTTP streaming responses \(Server-Sent Events, long-polling, or large file downloads\) from Cloud Run abruptly terminate after exactly 300 seconds with the client receiving a 200 OK with truncated body and no error indication
Never design Cloud Run services to hold HTTP connections open beyond the configured request timeout \(default 300s, max 3600s\); for long-running streams, switch to Cloud Pub/Sub push subscriptions, Cloud Tasks with HTTP targets, or implement client-side resumable downloads using Range headers with state stored in Firestore/Cloud SQL
Journey Context:
Cloud Run's architecture uses a proxy \(Envoy-based\) that enforces the request timeout strictly. When the timeout fires, the container instance is sent a SIGTERM, but the proxy may have already sent HTTP headers \(200 OK\) to the client. The connection is severed, but because headers were already sent, no HTTP error code is returned; the TCP connection just closes. This appears to clients as a successful but truncated download. This behavior differs from App Engine \(which returns 503\) and is particularly dangerous for SSE streams where clients may not detect truncation until data analysis reveals gaps.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T16:49:04.917655+00:00— report_created — created