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] 系统自适应限流 调用 SystemBlockException 构造方法 并抛出时 未初始化父类 BlockException 的成员变量 AbstractRule 导致捕获异常使用 EagleEyeLogUtil.log 记录日志时触发 空指针异常 #3255

Open
intjfyl opened this issue Nov 1, 2023 · 2 comments

Comments

@intjfyl
Copy link

intjfyl commented Nov 1, 2023

Issue Description

Type: bug report

Describe what happened

系统自适应限流 调用 SystemBlockException 构造方法 并抛出时 未初始化父类 BlockException 的成员变量 AbstractRule 导致捕获异常使用 EagleEyeLogUtil.log 记录日志时触发 空指针异常。
上述空指针异常 “掩盖” 了 抛出的 SystemBlockException,导致即使触发系统自适应保护,请求仍会发送到后台的接口。

Describe what you expected to happen

触发系统自适应保护后,正常抛出并记录异常,后台接口接收不到请求。

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

  1. 使用 1.8.6 版本的 sentinel 依赖
  2. 配置系统自适应保护规则
  3. 触发配置的规则,使代码抛出 SystemBlockException 异常
  4. 在 com.alibaba.csp.sentinel.slots.system.SystemRuleManager#checkSystem 处打断点,逐步调试观察异常抛出和处理逻辑
  5. com.alibaba.csp.sentinel.slots.logger.LogSlot#entry 处 观测到空指针异常产生

image

Tell us your environment

  • Windows开发环境
  • 1.8.6 版本的 sentinel
@msly
Copy link

msly commented Dec 5, 2023

#2853 引入的bug @sczyh30

@xixihaha520389
Copy link

哈哈,刚刚也发现了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants