alibaba / Sentinel

A powerful flow control component enabling reliability, resilience and monitoring for microservices. (面向云原生微服务的高可用流控防护组件)
https://sentinelguard.io/
Apache License 2.0
22.35k stars 8.02k forks source link

[BUG] 关于热点参数不生效的讨论 #3453

Open jasonpyf opened 3 hours ago

jasonpyf commented 3 hours ago

我在sentinel-dashboard配置了一个接口的热点规则但是没有生效,于是我就进行了DEBUG调试 我发现当一个接口被请求之后,首先进入的是一个SentinelWebInterceptor image SentinelWebInterceptor继承AbstractSentinelInterceptor抽象类,preHandle方法被调用 image 在这个方法中会调用SphU.entry方法 Entry entry = SphU.entry(resourceName, ResourceTypeConstants.COMMON_WEB, EntryType.IN); 但是SphU.entry没有传递当前接口请求的参数 image

在SphU.entry方法内部它传递的是一个默认常量OBJECTS0(对象数组,长度为0) image

最终导致在ParamFlowSlot类中方法entry被调用的时候args是一个长度为0的对象数组 image

在ParamFlowChecker类中方法passCheck始终true image

上面是我调试的结果

jasonpyf commented 2 hours ago

sentinel版本1.8.6