热点限流资源优化建议
- Dominant language
- Java
- Stars
- 23.1k
- Forks
- 8.1k
- PR merge metrics
- No merged PRs in 30d
Description
原因:
sentinel 会对所有mapping生成一个资源。
如果热点资源再用mapping时,
会造成 一个请求进两次热点限流。
类名 ParamFlowSlot
方法名 entry
会有下面这个判断,不足以跳过不是从SentinelResourceAspect 拦截进来的请求。这会造成限流问题。
if (!ParamFlowRuleManager.hasRules(resourceWrapper.getName())) {}
建议:热点限流在sentinel 控制台录入时在资源后面加个后缀,,,或者加个后缀字段。
客户端在SentinelResourceAspect 在resourceName获取后也加上这个后缀。即可解决这个问题
Contributor guide
Research direction
Start by reading ParamFlowSlot.entry and the SentinelResourceAspect resourceName handling described in the issue, then trace how hotspot resources are entered from mappings and recorded in the Sentinel console. Done means requests are not subjected to hotspot limiting twice, while resources entered through SentinelResourceAspect remain distinguishable and the affected behavior is covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100