Skip to content
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

Research and add defaults to HTTP resilience content #41611

Merged
merged 3 commits into from
Jul 2, 2024

Conversation

IEvangelist
Copy link
Member

@IEvangelist IEvangelist commented Jul 1, 2024

Summary

Researched and add defaults to HTTP resilience content

Fixes #41610 β€” CC: @martincostello


Internal previews

πŸ“„ File πŸ”— Preview link
docs/core/resilience/http-resilience.md Build resilient HTTP apps: Key development patterns

@IEvangelist IEvangelist requested a review from a team as a code owner July 1, 2024 18:34
@dotnet-bot dotnet-bot added this to the July 2024 milestone Jul 1, 2024
@IEvangelist IEvangelist changed the title Researched and add defaults to HTTP resilience content Research and add defaults to HTTP resilience content Jul 1, 2024
@IEvangelist IEvangelist enabled auto-merge (squash) July 1, 2024 19:28
IEvangelist and others added 2 commits July 2, 2024 07:54
Co-authored-by: martintmk <103487740+martintmk@users.noreply.github.com>
Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM. Let's :shipit:

@IEvangelist IEvangelist merged commit 2b671e8 into dotnet:main Jul 2, 2024
8 checks passed
Additionally, these strategies handle the following exceptions:

- `HttpRequestException`
- `TimeoutRejectedException`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do the same thing for hedging? Just add circuit breaker exception too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I follow. So, the Hedging handler employs what defaults?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hedging has different ShouldHandle predicate compared to standard resilience:

https://github.com/dotnet/extensions/blob/b60b982e9b5bc6273aaed1f70f9002e381aae97a/src/Libraries/Microsoft.Extensions.Http.Resilience/Hedging/HttpClientHedgingResiliencePredicates.cs#L53

Maybe just note that status codes/exceptions are the same as compared to standard resilience, but hedging strategy also handles BrokenCircuitException.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add defaults to HTTP resiliency content
5 participants