Menu

1 / 4

Four Changes Worth Making This Week

ILLUMINATION - Medium·Raza Hussain·4 days ago
#jCZbLdqU
Reading 0:00
15s threshold

Member-only story

Four Changes Worth Making This Week

How do you set Rails HTTP timeouts without a retry storm? One call sent 27 requests, 17 after the caller left.

Raza Hussain

17 min read7 hours ago

--

Press enter or click to view image in full size Rails HTTP Timeouts: Retries, Backoff, and Circuit Breakers

My edge client had a 2-second Rails HTTP timeout and still waited 6.32 seconds before it failed. Behind it, the service that was actually down received 27 requests for that one call, and 17 of them arrived after the edge had already given up.

Nobody wrote a bad line of config to get there. Every hop used the same sensible-looking Faraday client, a 2-second timeout and two retries, and those settings multiply.

The fix starts at the edge. It sets a deadline, passes each attempt’s share of it down, and for cheap reads it’s the only hop allowed to retry. A circuit breaker then stops traffic to a dependency that has stopped answering.

I built that chain on my laptop.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.