Skip to content

Commit eb0134a

Browse files
lchaoerIEvangelist
andauthored
Update http-resilience.md (#46361)
* Update http-resilience.md Add a warning of using ShouldHandle in retry strategy, this is a lesson in our real practice, hope we can help more people. * Apply suggestions from code review --------- Co-authored-by: David Pine <[email protected]>
1 parent 4acbe1e commit eb0134a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

docs/core/resilience/http-resilience.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,9 @@ The preceding code:
203203

204204
There are many options available for each of the resilience strategies. For more information, see the [Polly docs: Strategies](https://www.pollydocs.org/strategies). For more information about configuring `ShouldHandle` delegates, see [Polly docs: Fault handling in reactive strategies](https://www.pollydocs.org/strategies#fault-handling).
205205

206+
> [!WARNING]
207+
> If you're using both retry and timeout strategies, and you want to configure the `ShouldHandle` delegate in your retry strategy, make sure to consider whether it should handle Polly's timeout exception. Polly throws a `TimeoutRejectedException` (which inherits from <xref:System.Exception>), not the standard <xref:System.TimeoutException>.
208+
206209
### Dynamic reload
207210

208211
Polly supports dynamic reloading of the configured resilience strategies. This means that you can change the configuration of the resilience strategies at run time. To enable dynamic reload, use the appropriate `AddResilienceHandler` overload that exposes the `ResilienceHandlerContext`. Given the context, call `EnableReloads` of the corresponding resilience strategy options:

0 commit comments

Comments
 (0)