-
Notifications
You must be signed in to change notification settings - Fork 726
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing documentation about standard HTTP resilience values #5078
Comments
I was also looking for
|
+1 .AddPolicyHandler(
static _ => HttpPolicyExtensions.HandleTransientHttpError()
.OrResult(static r => r.StatusCode == System.Net.HttpStatusCode.NotFound)
.WaitAndRetryAsync(
10,
static (_, result, _) => result.Result?.Headers.RetryAfter?.Delta.GetValueOrDefault() ?? TimeSpan.FromSeconds(5),
static (_, _, _, _) => Task.CompletedTask)); to use new Microsoft.Extensions.Http.Resilience, but the documentation is lacking. Please create a migration guide. |
Related to this, I would love to see an explanation for why the policies are there in the order they are in. As an example, why is the total request timeout policy inside/after the rate limit policy, when the rate limit policy can cause large delays if you enable queueing? For example...if you have a queue size of 10 and parallelism 1 and total request timeout = 30s, in the worst case scenario it could take that 10th queued request up to 300s, which is 10x higher than the total request timeout. This is either bad or I'm misunderstanding something, and it would be much easier to tell which if the motivation behind the standard policies were shared. |
This is a very good point and you are correct. Total timeout should cancel executions queued by rate limiter. We should change the order of strategies, total timeout should be on top. This is behavioral change, however, it's varanted. @tyler-boyd Can you create an improvement or bug fix ticket please? |
The current documentation is not saying anything about the default values for the total request timeout, attempt timeout, number of retries, circuit breaker break duration, failure ratio, etc when using
httpClientBuilder.AddStandardResilienceHandler();
The text was updated successfully, but these errors were encountered: