Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

update circuitbreaker document - #1808

#1808
Merged
martincostello merged 7 commits into
App-vNext:mainApp-vNext/Polly:mainfrom
atawLee:breakDurationDocatawLee/Polly:breakDurationDocCopy head branch name to clipboard
Dec 14, 2023
Merged

update circuitbreaker document #1808
martincostello merged 7 commits into
App-vNext:mainApp-vNext/Polly:mainfrom
atawLee:breakDurationDocatawLee/Polly:breakDurationDocCopy head branch name to clipboard

Conversation

@atawLee

@atawLee atawLee commented Nov 17, 2023

Copy link
Copy Markdown
Contributor

#1776

Update documentation for the CircuitBreaker's BreakDurationGenerator

Confirm the following

  • I started this PR by branching from the head of the default branch
  • I have targeted the PR to merge into the default branch
  • I have included unit tests for the issue/feature
  • I have successfully run a local build

@codecov

codecov Bot commented Nov 17, 2023

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (033b02f) 84.58% compared to head (5c6814f) 84.58%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1808   +/-   ##
=======================================
  Coverage   84.58%   84.58%           
=======================================
  Files         308      308           
  Lines        6799     6799           
  Branches     1049     1049           
=======================================
  Hits         5751     5751           
  Misses        839      839           
  Partials      209      209           
Flag Coverage Δ
linux 84.58% <ø> (ø)
macos 84.58% <ø> (ø)
windows ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@martincostello martincostello added this to the v8.2.0 milestone Nov 17, 2023

@martincostello martincostello left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Going through #1776 (comment) looks like just a diagram is needed to complete the suggestions.

Comment thread docs/strategies/circuit-breaker.md Outdated
atawLee and others added 3 commits November 17, 2023 23:11
## Defaults Align
Update the alignment of the table a bit more.
@peter-csala

Copy link
Copy Markdown
Contributor

@atawLee Do you need some help with the diagram? I can create one if you wish.

@atawLee

atawLee commented Dec 8, 2023

Copy link
Copy Markdown
Contributor Author

@atawLee Do you need some help with the diagram? I can create one if you wish.

Yes, I would really appreciate your help with the diagram.

@peter-csala

Copy link
Copy Markdown
Contributor

@atawLee Do you need some help with the diagram? I can create one if you wish.

Yes, I would really appreciate your help with the diagram.

Here it is:

sequenceDiagram
    autonumber
    actor C as Caller
    participant P as Pipeline
    participant CB as CircuitBreaker
    participant BDG as BreakDurationGenerator
    participant D as DecoratedUserCallback

    C->>P: Calls ExecuteAsync
    P->>CB: Calls ExecuteCore
    Note over CB: Closed state
    CB->>+D: Invokes
    D->>-CB: Fails
    Note over CB: Moves to Open state
    CB->>+BDG: Calls Generator
    BDG->>-CB: Returns calculated <br/> duration 
    Note over CB: Break duration start
    CB->>P: Propagates failure
    P->>C: Propagates failure

    C->>P: Calls ExecuteAsync
    P->>CB: Calls ExecuteCore
    CB-->>CB: Rejects request
    CB->>P: Throws <br/>BrokenCircuitException
    P->>C: Propagates exception

    C->>P: Calls ExecuteAsync
    P->>CB: Calls ExecuteCore
    Note over CB: Break duration end
    Note over CB: Moves to HalfOpen state
    CB->>+D: Invokes
    D->>-CB: Returns result
    Note over CB: Moves to Closed state
    CB->>P: Returns result
    P->>C: Returns result
Loading

And the code:

sequenceDiagram
    autonumber
    actor C as Caller
    participant P as Pipeline
    participant CB as CircuitBreaker
    participant BDG as BreakDurationGenerator
    participant D as DecoratedUserCallback

    C->>P: Calls ExecuteAsync
    P->>CB: Calls ExecuteCore
    Note over CB: Closed state
    CB->>+D: Invokes
    D->>-CB: Fails
    Note over CB: Moves to Open state
    CB->>+BDG: Calls Generator
    BDG->>-CB: Returns calculated <br/> duration 
    Note over CB: Break duration start
    CB->>P: Propagates failure
    P->>C: Propagates failure

    C->>P: Calls ExecuteAsync
    P->>CB: Calls ExecuteCore
    CB-->>CB: Rejects request
    CB->>P: Throws <br/>BrokenCircuitException
    P->>C: Propagates exception

    C->>P: Calls ExecuteAsync
    P->>CB: Calls ExecuteCore
    Note over CB: Break duration end
    Note over CB: Moves to HalfOpen state
    CB->>+D: Invokes
    D->>-CB: Returns result
    Note over CB: Moves to Closed state
    CB->>P: Returns result
    P->>C: Returns result

Enjoy 💪

@martincostello

Copy link
Copy Markdown
Member

BreakDurationGenerator needs adding to the spellcheck dictionary.

Comment thread docs/strategies/circuit-breaker.md Outdated
Co-authored-by: Martin Costello <martin@martincostello.com>
@martincostello
martincostello merged commit 51a0ff2 into App-vNext:main Dec 14, 2023
@martincostello martincostello modified the milestones: v8.2.0, v8.3.0 Dec 14, 2023
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.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.