A third-party API starts timing out. What do I do?
Practice this questionShort explanation:
A third-party timeout means your service did not receive an answer within its waiting budget. It does not prove that the remote operation was never performed. Timeouts need bounded waiting, controlled concurrency and a strategy for uncertain results, especially for actions with side effects.
Key points:
-
Set deadlines and cap concurrent requests so the app does not pile up work.
-
Retry temporary failures only when safe, with backoff and jitter.
-
Use a circuit breaker, delayed jobs or a clear degraded response; reconcile uncertain side effects.
-
Respect
Retry-Afterand the provider's idempotency or status-query mechanisms when available. -
Stop repeated calls temporarily when failure is persistent, and expose pending or degraded status to users.
Interview point:
- Distinguish retrying a read from retrying an uncertain payment or notification send.