Closed poscat0x04 closed 3 years ago
You seem to be confused by the definition of httpConfigRetryJudgeException
. This function only tells us when to retry. The number of retries and the time intervals between them are set in the httpConfigRetryPolicy
: https://github.com/mrkkrp/req/blob/master/Network/HTTP/Req.hs#L536-L540. By default, we use retryPolicyDefault
: https://github.com/mrkkrp/req/blob/master/Network/HTTP/Req.hs#L746, which says:
The default retry policy retryPolicyDefault implements a constant 50ms delay, up to 5 times
http://hackage.haskell.org/package/retry-0.8.1.2/docs/Control-Retry.html#t:RetryPolicyM
Yeah, you're right. Sorry. I guess I should read the code more carefully.
Currently, under the default setting req will retry forever if the exception thrown by http-client is a
ResponseTimeout
or aConnectionTimeout
. This can potentially lead the program to block indefinitely under the circumstances where throwing an exception is more desirable, say, for example, when the network is down or the server you are requesting to is down. I feel like there should be a default retrying limit.