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

Degrade by RT should consider inflight request #1405

Open
wavesZh opened this issue Apr 14, 2020 · 4 comments · May be fixed by #2123
Open

Degrade by RT should consider inflight request #1405

wavesZh opened this issue Apr 14, 2020 · 4 comments · May be fixed by #2123
Labels
area/circuit-breaking Issues or PRs related to circuit breaking kind/enhancement Category issues or prs related to enhancement.

Comments

@wavesZh
Copy link
Contributor

wavesZh commented Apr 14, 2020

Issue Description

Type: feature request

Describe what happened (or what feature you want)

Now degrading by RT only consider finished requests because rt stat is collected when exit, but it ingores inflight requests. I thinks it is not accurate:
When the count of inflight and overtime requests has exceeds threshold, but Sentinel will allow the below requests.

Describe what you expected to happen

Tell us your environment

Anything else we need to know?

@sczyh30 sczyh30 added area/circuit-breaking Issues or PRs related to circuit breaking kind/enhancement Category issues or prs related to enhancement. labels Apr 14, 2020
@sczyh30
Copy link
Member

sczyh30 commented Apr 15, 2020

Good suggestion. This could be helpful for sparse slow requests. We could discuss the detail of the strategy here :)

@sczyh30
Copy link
Member

sczyh30 commented Jun 11, 2020

Any thoughts? (maybe combine with concurrency control?)

@wavesZh
Copy link
Contributor Author

wavesZh commented Jun 11, 2020

Could you give me more informations about it?
I am confused about sparse slow requests and concurrency control because I can not associate them with my issuse.

@single-wolf
Copy link

IMHO, the PR #1490 seems did not fix this issue.

The main point of problem is that ** Whether the Sentinel circuit breaker can cut off the traffic when it know inflight entries will trigger the breaker finally,instead of all unexpected slow entries exit **

At some implementations such as hystrix , another thread will perform some fallback work when a actual working thread does not return after a timeout. With the current structure of Sentinel, it is not suitable to achieve a similar implementations, but some designs can be used to achieve the same effect:

  1. the sample count of SlowRequestLeapArray should be calculated by maxAllowedRt/statIntervalMs, and the window length should be setted as statIntervalMs.
  2. SlowRequestCounter should count inflight entries and track predecessor deprecated bucket after reset().
  3. tryPass() should increment total, inflight, slow counter, and each new window should check prev inflight request once.
  4. onRequestComplete() should decrement inflight and slow counter optionally, when that is slow entry, it also check current window.

I will try to work on it, any other thoughts? ;-)

single-wolf added a commit to single-wolf/Sentinel that referenced this issue Apr 11, 2021
…ing previous buckets when the entry tries to pass (alibaba#1405)

Signed-off-by: Jerry.Zhong <15951609026@163.com>
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/enhancement Category issues or prs related to enhancement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants