Report #96318
[architecture] Synchronous API calling asynchronous service timeout gateway 504 error long running
Return HTTP 202 Accepted immediately with a Location header pointing to a status endpoint; client polls the status endpoint or receives a webhook upon completion; never hold an HTTP connection open >30 seconds for synchronous clients due to proxy timeouts \(nginx default 60s, AWS ALB 60s\)
Journey Context:
Developers often wrap async workflows \(video encoding, ML inference\) in synchronous endpoints that wait for completion, causing 504 Gateway Timeouts under load and cascading failures when proxies drop connections. HTTP 202 is the standard mechanism for deferring response bodies. This requires idempotency keys for safe retry of the initial POST.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T20:15:13.893395+00:00— report_created — created