Skip to content

Circuit breaking implementation #13

@louyuting

Description

@louyuting

Issue Description

Circuit breaker

Describe what feature you want

                                          |                                                                                                                    
                                          |                                                                                                                    
                                          |                                                                                                                    
                                          |                                                                                                                    
                                          |  update rules dynamically                                                                                          
                                          |                                                                                                                    
                                          |                                                                                                                    
                                          |                                                                                                                    
                +-------------------------+-------------------------------------------------------------------------------------------------------------------+
     entry      |                         |                                  Circuit Breaker Slot                                                             |
                |                         v                                                                                                                   |
  --------------+->                                                                                                                                           |
                |                                                                                                                                             |
                |  +-----------------------------+    +-----------------------------+    +-----------------------------+   +-----------------------------+    |
                |  | +-------------------------+ |    | +-------------------------+ |    | +-------------------------+ |   | +-------------------------+ |    |
                |  | |                         | |    | |                         | |    | |                         | |   | |                         | |    |
                |  | |  AverageRtBreakerRule   | |    | |  ErrorRatioBreakerRule  | |    | |  ErrorCountBreakerRule  | |   | |     XXXBreakerRule      | |    |
                |  | |                         | |    | |                         | |    | |                         | |   | |                         | |    |
                |  | +-----------^-------------+ |    | +------------^------------+ |    | +-----------^-------------+ |   | +------------^------------+ |    |
                |  |             |               +--->|              |              +--->|             |               +-->|              |              |    |
                |  | +-----------+-------------+ |    | +------------+------------+ |    | +-----------+-------------+ |   | +------------+------------+ |    |
                |  | | AverageRtCircuitBreaker | |    | |ErrorRatioCircuitBreaker | |    | |ErrorCountCircuitBreaker | |   | | XXXCountCircuitBreaker  | |    |
                |  | |       .CanPass()?       | |    | |       .CanPass()?       | |    | |       .CanPass()?       | |   | |       .CanPass()?       | |    |
                |  | |                         | |    | |                         | |    | |                         | |   | |                         | |    |
                |  | +-------------------------+ |    | +-------------------------+ |    | +-------------------------+ |   | +-------------------------+ |    |
                |  +-----------------------------+    +-----------------------------+    +-----------------------------+   +-----------------------------+    |
                |                                                                                                                                             |
                +---------------------------------------------------------------------------------------------------------------------------------------------+

There are Four main entity:
XXXBreakerRule: rule status machine
XXXCircuitBreaker: the check logic whether
RuleManager: manage all XXXCircuitBreakers and update rules dynamically.
CircuitBreakerSlot: As a CheckSlot to encapsulate all logic about circuit breaker.

Metadata

Metadata

Assignees

Labels

area/circuit-breakingIssues or PRs related to circuit breakingkind/featureCategory issues or PRs related to feature request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions