Report #40990
[architecture] Holding HTTP requests open for long-running processing causes gateway timeouts and cascading failures
For operations expected to exceed 5 seconds, immediately return HTTP 202 Accepted with a Location header pointing to a status endpoint \(or use webhooks\), then process asynchronously; never await long I/O in the synchronous request path.
Journey Context:
Developers confuse 'async/await' in code with asynchronous architecture. Using async/await in Python \(FastAPI\) or Node.js still keeps the HTTP connection open; if the database query takes 30 seconds, the connection pool exhausts and the load balancer returns 504 Gateway Timeout. The 202 Accepted status code \(RFC 7231\) signals the request is valid but not yet processed. The client polls the Location header or receives a webhook. This decouples acceptance from processing, essential for resilient distributed systems.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T23:16:19.317568+00:00— report_created — created