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

[BUG] Flow control by related resource leads to the failure of origin flow limit #3315

Open
Daydreamer-ia opened this issue Jan 24, 2024 · 2 comments
Labels
area/flow-control Issues or PRs related to flow control kind/question Category issues related to questions or problems

Comments

@Daydreamer-ia
Copy link

Issue Description

Version: V1.8.7
I use the dashboard to raise a related resource flow control as follow.
我使用dashboard创建了一个关联规则如下:
1706101221512
As user, we will think the base control of "hello" will limit the qps under 1. And flow limit of the resource "helloAnother" will cause the limit to "hello". But the fact seems to be different. The flow control rule with QPS limit of 1 does not seem to be in effect.
作为用户,我们会认为hello资源会被限制在QPS为1和之下,以及helloAnother的限流也会导致hello资源的限流。但是实际情况貌似不是这样的,对QPS限制为1的规则似乎并没有生效。

I follow with the debug to find FlowRuleChecker#passLocalCheck. It gets ClusterNode of "helloAnother" when visit resource "hello". The qps of "hello" is ignored.
我跟随了代码找到 FlowSlot,以及 FlowRuleChecker#passLocalCheck,在访问资源hello时,它获取的数据统计节点是资源helloAnother的,对于资源hello的qps并没有参与计算,导致hello的qps被忽略了。
1706101314108

Describe what happened

The flow control rule with QPS limit of 1 does not seem to be in effect.

Describe what you expected to happen

QPS higher than 1 and flow limit of "helloAnother" resources can both lead to flow limit of "hello" resource.

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

  1. Start the sentinel-demo-annotation-spring-aop.
  2. Create a related resource rule for "hello" resource in demo. Limit the qps under 1 and link with resource "helloAnother".
  3. Try to visit /foo in brower.

Tell us your environment

Anything else we need to know?

@sczyh30 sczyh30 added kind/question Category issues related to questions or problems area/flow-control Issues or PRs related to flow control labels Jan 25, 2024
@sczyh30
Copy link
Member

sczyh30 commented Jan 25, 2024

“关联”的实际效果就是参考关联资源的指标来限制当前 resource 的流量,而与当前 resource 的指标无关,具体的生效方式可以参考 https://sentinelguard.io/zh-cn/docs/flow-control.html

@Daydreamer-ia
Copy link
Author

“关联”的实际效果就是参考关联资源的指标来限制当前 resource 的流量,而与当前 resource 的指标无关,具体的生效方式可以参考 https://sentinelguard.io/zh-cn/docs/flow-control.html

感谢,明白了。不过在dashboard的ui上,建议是在选择到"关联"的时候,把阈值输入那些给隐藏了,不然可能存在误导

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/flow-control Issues or PRs related to flow control kind/question Category issues related to questions or problems
Projects
None yet
Development

No branches or pull requests

2 participants