-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Calculated break duration for Circuit breaker #1776
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>
src/Polly.Core/CircuitBreaker/BreakDurationGeneratorArguments.cs
Outdated
Show resolved
Hide resolved
test/Polly.Core.Tests/CircuitBreaker/BreakDurationGeneratorArgumentsTests.cs
Show resolved
Hide resolved
test/Polly.Core.Tests/CircuitBreaker/Controller/AdvancedCircuitBehaviorTests.cs
Show resolved
Hide resolved
test/Polly.Core.Tests/CircuitBreaker/Controller/AdvancedCircuitBehaviorTests.cs
Outdated
Show resolved
Hide resolved
modify convention Co-authored-by: Martin Costello <martin@martincostello.com>
Upon further review, it has been confirmed that the warning in question is valid, and after checking the git Action, it has become apparent that this part is causing the issue. Therefore, I will reapply the disable pragma for this section.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1776 +/- ##
==========================================
+ Coverage 84.53% 84.56% +0.03%
==========================================
Files 307 308 +1
Lines 6777 6791 +14
Branches 1043 1044 +1
==========================================
+ Hits 5729 5743 +14
Misses 839 839
Partials 209 209
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
FailureCount
get property toCircuitBehavior
to retrieve the count of failures._breakDurationGenerator
of typeFunc<BreakDurationGeneratorArguments, ValueTask<TimeSpan>>?
toCircuitStateController
for dynamic break duration generation.CircuitStateController
with an overload to accommodate_breakDurationGenerator
.FailureCount
intoHealthInfo
.OpenCircuitFor_NeedsLock
to assign the_blockedUntil
value based on both the presence ofbreakDuration
and the number of failures.This new Pull Request is a continuation of the work on the
GeneratorDuration
branch. 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