alibaba / alibaba/Sentinel

FlowRuleChecker.passClusterCheck limitApp does not take effect | 集群流控不支持针对来源

Open
#2,318 0 comments 0 reactions 0 assignees View on GitHub
area/cluster-flow area/flow-control
Dominant language
Java
Stars
23.1k
Forks
8.1k
PR merge metrics
No merged PRs in 30d

Description

## Issue Description

Type: *bug report*
FlowRuleChecker

### Describe what happened (or what feature you want)
为同一资源配置多条规则,比如配置如下两条规则:
1、来源应用appA,集群限流
2、来源应用appB,单机限流

在根据应用来源限流时,两条限流规则都执行了
单机限流规则,进行了上下文**Context的origin和FlowRule的limitApp是否相等判断**,
集群限流规则,未进行判断,导致来源于应用**appA**的请求进入了**passClusterCheck**,并且**去token server获取了toke**n

### Describe what you expected to happen
校验规则时,集群限流也根据调用方限流,来源与规则配置的limitApp不匹配时,不应该再进行集群限流

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

1、为同一资源配置多条规则,比如配置如下两条规则:
a、来源应用appA,集群限流
b、来源应用appB,单机限流
2、appA应用发起请求

### Tell us your environment
JDK8
spring-boot 2.3.0.RELEASE
sentinel 1.8
spring-cloud-starter-alibaba-sentinel 2.2.6.RELEASE

### Anything else we need to know?

Contributor guide

Open the contributing guide

Research direction

Start at the reported FlowRuleChecker.passClusterCheck entry point and trace how the caller origin is matched against each rule's limitApp. Reproduce the two-rule case with appA and appB, then verify that an appA request does not enter the appB cluster-limiting path or contact the token server.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring-boot
Domain
backend, distributed-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.