A production API integration calls Claude for document processing that occasionally takes 55–70 seconds. The team reports intermittent TimeoutError exceptions at the 60-second mark. Infrastructure review shows: API gateway timeout = 60s, application server timeout = 90s, HTTP client timeout = 120s. What is the correct fix?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Here's the deal — c is correct because the root cause is that synchronous HTTP connections are fundamentally incompatible with processing times that approach or exceed infrastructure timeout limits. Refactoring to async (job submission + polling or webhook) eliminates the timeout problem entirely — the connection that submits the job completes in milliseconds, and result retrieval happens independently.
Full explanation below image
Full Explanation
C is correct because the root cause is that synchronous HTTP connections are fundamentally incompatible with processing times that approach or exceed infrastructure timeout limits. Refactoring to async (job submission + polling or webhook) eliminates the timeout problem entirely — the connection that submits the job completes in milliseconds, and result retrieval happens independently. B is wrong because increasing the API gateway timeout to 90s only shifts the failure point — requests taking 70s would succeed, but any future increase in processing time would hit the new limit; and cascading timeout mismatches across multiple infrastructure layers create maintenance complexity. A is wrong because the bottleneck is the API gateway at 60s, not the HTTP client — increasing the client timeout does not affect the gateway. D is wrong because retrying a timed-out Claude request starts the entire processing from scratch, doubling or tripling cost and latency without fixing the underlying timeout architecture problem.