Skip to content
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

Fuse (abnormal proportion) and continuous failure within 1s after recovery <5 times will not enter the fuse again, and the failure will be quickly blown once successfully. #976

Closed
Warkeeper opened this issue Aug 9, 2019 · 1 comment
Labels
area/circuit-breaking Issues or PRs related to circuit breaking kind/question Category issues related to questions or problems

Comments

@Warkeeper
Copy link

Warkeeper commented Aug 9, 2019

Describe what happened (or what feature you want)

在使用异常比例进行熔断时,当熔断结束并恢复之后,在一开始的几笔交易中:
情况一:如果连续失败且失败次数<5,不会再次进入熔断,失败次数达到5笔,尝试第六笔交易时,会进入熔断
情况二:如果恢复后的第一笔交易失败,而第二笔交易成功,在尝试第三笔交易时就会立刻进入失败。我配置的是50%的异常比例。(如果连续失败N笔,N<5,N+1笔成功后,N+1笔会进入熔断)

Describe what you expected to happen

针对情况一:我认为应该熔断恢复后仍然失败应该继续熔断
针对情况二:同情况一

How to reproduce it (as minimally and precisely as possible)

  1. 配置熔断为异常比例,比例值我配的是 50%,timewindow 为 2s
  2. 触发熔断
    3.1 控制熔断后的N笔交易为失败(N<5),其余为成功
    3.2 控制熔断后的N笔交易为失败(N<4),N+1笔为成功

Anything else we need to know?

其实连续失败5次后才熔断的逻辑我认为是正常的,因为是判定一秒内至少有五笔请求才会去判断熔断逻辑。但是让人感到诡异的是,熔断恢复后如果第一笔失败,第二笔成功,只要我配置的熔断比例值<50,就一定会触发熔断。(不过看了一下源码好像是因为触发 熔断判断的五笔请求 是包含mock方法的,但mock方法的结果既不是成功也不是异常)

@sentinel-bot sentinel-bot changed the title 熔断(异常比例)并恢复后的1s内连续失败<5次不会再次进入熔断,而失败一次成功一次则会快速熔断 Fuse (abnormal proportion) and continuous failure within 1s after recovery <5 times will not enter the fuse again, and the failure will be quickly blown once successfully. Aug 9, 2019
@sentinel-bot sentinel-bot added the kind/bug Category issues or prs related to bug. label Aug 9, 2019
@sczyh30 sczyh30 added area/circuit-breaking Issues or PRs related to circuit breaking kind/question Category issues related to questions or problems and removed kind/bug Category issues or prs related to bug. labels Aug 15, 2019
@sczyh30
Copy link
Member

sczyh30 commented Apr 28, 2021

This has been improved in 1.8.x (with half-open state). You may refer to the latest doc: https://github.com/alibaba/Sentinel/wiki/Circuit-Breaking

@sczyh30 sczyh30 closed this as completed Apr 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/circuit-breaking Issues or PRs related to circuit breaking kind/question Category issues related to questions or problems
Projects
None yet
Development

No branches or pull requests

3 participants