App-vNext / Polly-Samples

Provides sample implementations of the Polly library. The intent of this project is to help newcomers kick-start their use of Polly within their own projects.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

circuitBreakerStrategy never opens

warren-pieterse opened this issue · comments

In the Demo06_WaitAndRetryNestingCircuitBreaker the only message logged is "Strategy logging: ...". the "circuit breaker strategy: break if the action fails at least 4 times in a row" never happens?

Am I missing something?

Let me check it. @martincostello Please assign to me

I've found the issue. :)

The FailureRatio was set to 1.0, that means all requests should fail during the sampling period.
But I've forget to set the SamplingDuration that's why it used the default value which is 30 seconds.

After setting the SamplingDuration to 2 seconds then the CB breaks nicely:

Screenshot 2023-10-12 at 14 20 00

I'll file a PR with a fix shortly.