Feature #10674

Net::HTTP retries idempotent requests once after a timeout, but its not configurable

Added by jlecour (Jérémy Lecour) about 6 years ago. Updated over 3 years ago.

Target version:



I've noticed that Net::HTTP retries idempotent requests once after a time-out. It seems to adhere to the RFC 2616 (, but it is not always the best thing to do.

When you don't know exactly how a remote web service works, it may be wise to retry after a time-out.
But when you know that a retry won't change anything, it should be possible to disable this automatic retry. Otherwise, the server will have to deal with 2 requests (instead of 1) and the client will effectively time-out twice later than expected (time for the first and second time-out).

Having a basic "#retry=" (like we have "#read_timeout=" or "#open_timeout" would be good first step.
The value could be a simple boolean, or even an integer for the maximum number of retries.

The "Retry" middleware in Faraday has a more comprehensive feature set with max retries, exponential back-off, … :

Also available in: Atom PDF