I am using HTTPClient
with WinHttpHanlder
(for http/2) and my Polly retry policy looks something like this
var waitAndRetry = Policy.HandleResult<HttpResponseMessage>(r => HTTPCodesWorthRetrying(r)).Or<HandleRequestException>().Or<TimeoutRejectionException>(). WaitAndRetryAsync( 3, retryAttempt => ExponentialBackoff(retryAttempt), onRetry => { //some logging })
I have noticed that in case of HandleRequestException
(with IOException
or WinHttpException
as inner exceptions) call is retried 3 times but still fails.
My question is :
Does Polly reconnects and establishes new connection during retry on errors like "connection was terminated abnormally" or "A connection with server could not be established" etc or "Server returned invalid or unrecognized response".
Or I am retrying too quickly, initial retry delay is 100ms ?
Did not find any details in polly documentation.