知识卡片
熔断阻挡后续请求
重试处理单次调用,熔断对共享目标的后续请求做快速拒绝。实用协议要定义统计窗口、打开条件、少量恢复探测、闭合条件,并考虑并发检查和在途任务。若长期累计错误永不衰减,正常系统最终也可能被打开。关联 [[指数退避抑制重试峰值]]。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Chapter 9. Design Patterns 熔断维护共享故障状态 · 查看原书依据
The premise is fairly simple. If OPEN is true, we state that the circuit is open, and we can no longer spawn new tasks. If an error occurs, we increase COUNT by one and set OPEN to true if COUNT exceeds the threshold. We also need to write our own spawn_task function that checks OPEN before spawning a task. Our spawn_task function takes the following
参考来源
- 位置:《Async Rust Unleashing the Power of Fearless Concurrency (Maxwell Flitton, Caroline Morton)》第09章《Chapter 9. Design Patterns》,熔断维护共享故障状态(来源项目 book-source,extracted/Async Rust Unleashing the Power of Fearless Concurrency (Maxwell Flitton, Caroline Morton)/_epub-src/OEBPS/ch09.html#id62)
- 结论依据:原书在错误计数达到阈值后开启熔断标志,提交入口据此快速拒绝。
- 原始内容:The premise is fairly simple. If OPEN is true, we state that the circuit is open, and we can no longer spawn new tasks. If an error occurs, we increase COUNT by one and set OPEN to true if COUNT exceeds the threshold. We also need to write our own spawn_task function that checks OPEN before spawning a task. Our spawn_task function takes the following