roy500

roy500

Member Since 5 years ago

Experience Points
0
follower
Lessons Completed
0
follow
Lessons Completed
2
stars
Best Reply Awards
3
repos

5 contributions in the last year

Pinned
⚡ 2.6.40aa151 docker稳定安装版
⚡ Rap2 前端代码
⚡ A powerful flow control component enabling reliability, resilience and monitoring for microservices. (面向云原生微服务的高可用流控防护组件)
Activity
Mar
28
1 month ago
pull request

roy500 pull request alibaba/Sentinel

roy500
roy500

提供spring的全局异常处理器,会导致熔断规则(异常数规则)失效解决方案

Describe what this PR does / why we need it

srntinel-spring-webmvc-adapter使用HandlerInterceptor做异常统计等处理,但在实际开发中都会用@ControllerAdvice全局异常处理如下: image

因为拦截顺序会按照controller -> aspect -> controllerAdvice -> interceptor -> filter往下走,这导致异常已在ControllerAdvice被捕获处理,HandlerInterceptor无法统计异常

Does this pull request fix one issue?

Fixes #2461

Describe how you did it

在AbstractSentinelInterceptor下添加与afterCompletion处理相同的方法exceptionControllerAdviceExit,提供给全局异常捕获类调用如下: image image 这样就可以捕获系统异常,自定义的业务异常也是同样调用,这里也不用担心会统计两次afterCompletion下的increaseReferece做了判断

Describe how to verify it

只要定义异常捕获处理都无法对异常进行统计,业务异常也是如此 image

Special notes for reviews

Activity icon
issue

roy500 issue comment alibaba/Sentinel

roy500
roy500

Sentinel 1.8.3 异常数统计不正确

Sentinel 1.8.3 异常数统计不正确

image
Mar
10
2 months ago
Activity icon
issue

roy500 issue comment alibaba/Sentinel

roy500
roy500

提供spring的全局异常处理器,会导致熔断规则(异常数规则)失效解决方案

Describe what this PR does / why we need it

srntinel-spring-webmvc-adapter使用HandlerInterceptor做异常统计等处理,但在实际开发中都会用@ControllerAdvice全局异常处理如下: image

因为拦截顺序会按照controller -> aspect -> controllerAdvice -> interceptor -> filter往下走,这导致异常已在ControllerAdvice被捕获处理,HandlerInterceptor无法统计异常

Does this pull request fix one issue?

Fixes #2461

Describe how you did it

在AbstractSentinelInterceptor下添加与afterCompletion处理相同的方法exceptionControllerAdviceExit,提供给全局异常捕获类调用如下: image image 这样就可以捕获系统异常,自定义的业务异常也是同样调用,这里也不用担心会统计两次afterCompletion下的increaseReferece做了判断

Describe how to verify it

只要定义异常捕获处理都无法对异常进行统计,业务异常也是如此 image

Special notes for reviews

roy500
roy500