Report #83199
[architecture] HTTP request timeouts and cascading latency from slow synchronous downstream calls \(email, 3rd party APIs\)
Keep synchronous boundary for operations completing in <100ms \(auth, cache, primary DB reads\). For >500ms or unreliable operations \(email, webhooks, OCR, external APIs\), return HTTP 202 Accepted immediately, persist the job to a durable queue \(SQS, RabbitMQ\), and provide a status endpoint or WebSocket for completion notification. Never hold an HTTP connection open for >5s.
Journey Context:
Synchronous calls hold threads \(or event loop\) captive, exhausting connection pools during slowdowns. The Doherty Threshold states user perception degrades after 400ms; waiting for an email SMTP handshake \(often 1-3s\) violates this. Async introduces eventual consistency pain \(job loss, retry storms\), which is why you must use a \*durable\* queue \(not in-memory\) and return 202 to signal acceptance vs completion. The 100ms/500ms threshold is practical: if you can't guarantee sub-100ms, assume failure. This pattern is distinct from 'fire-and-forget' because you must provide status tracking for non-idempotent side effects.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T22:14:22.277004+00:00— report_created — created