Calculated break duration for Circuit breaker#1776
Calculated break duration for Circuit breaker#1776martincostello merged 40 commits intoApp-vNext:mainfrom
Conversation
- CircuitStateControllerTest - RollingHealthMetrixTest
apply code convention feedback Co-authored-by: Martin Costello <martin@martincostello.com>
Add CircuitBreaker BreakDurationGenerator Document Update Usage Update Anti-pattern
Add CircuitBreaker BreakDurationGenerator Document Update Usage Update Anti-pattern
- CircuitStateControllerTest - RollingHealthMetrixTest
apply code convention feedback Co-authored-by: Martin Costello <martin@martincostello.com>
…into DurationGenerator
Update conventions and comments Co-authored-by: martintmk <103487740+martintmk@users.noreply.github.com> Co-authored-by: Martin Costello <martin@martincostello.com>
Update conventions and comments Co-authored-by: Martin Costello <martin@martincostello.com>
…into DurationGenerator
HealthInfo - Remove Default Parameter Argument - Missing XML documentation for the constructor and properties, ResilienceContext
Modify code conventions Co-authored-by: martintmk <103487740+martintmk@users.noreply.github.com> Co-authored-by: Martin Costello <martin@martincostello.com>
martintmk
left a comment
There was a problem hiding this comment.
Looks good. Great work and thanks for contributing :)
|
@atawLee Is the related documentation purposefully left untouched (until v8.2.0 is not released)? |
|
I think that's just an oversight (it certainly is that I didn't notice we hadn't changed it). |
|
@peter-csala it seems there might have been an oversight regarding the documentation update. Could you please guide me on which specific documents need to be revised? |
|
|
@atawLee Will you be able to raise a PR to make the documentation updates for your change? |
|
@martincostello Hi there, I'm currently working on the documentation updates for my change. I expect to be able to raise a Pull Request by the end of this week. |
|
There is an issue with this. When you call AddCircuitBreaker(options), having specified BreakDurationGenerator. It does not pass the generate to the CircuitStateController. So the resulting circuitbreaker will use the default 5 seconds fixed duration. |
|
@adminnz Thanks for reporting this. Would you mind creating a new issue with more details about your use case, then we can look at a fix. |
The issue or feature being addressed
#653
Details on the issue fix or feature implementation
FailureCountget property toCircuitBehaviorto retrieve the count of failures._breakDurationGeneratorof typeFunc<BreakDurationGeneratorArguments, ValueTask<TimeSpan>>?toCircuitStateControllerfor dynamic break duration generation.CircuitStateControllerwith an overload to accommodate_breakDurationGenerator.FailureCountintoHealthInfo.OpenCircuitFor_NeedsLockto assign the_blockedUntilvalue based on both the presence ofbreakDurationand the number of failures.This new Pull Request is a continuation of the work on the
GeneratorDurationbranch. It includes all the changes previously submitted and any additional fixes required to align with the main branch.#1715
I am currently working on improving the Test Coverage to ensure the robustness of the new features. This work is still in progress, and I will update this PR with the relevant changes as soon as they are ready.
Confirm the following