GatewayRuleManager NPE when updating rules
- Dominant language
- Java
- Stars
- 23.1k
- Forks
- 8.1k
- PR merge metrics
- No merged PRs in 30d
Description
## Issue Description
Type: *bug report* or *feature request*
### 哨兵控制台更新流控规则,网关在 更新规则时抛出空指针异常,更新失败。
java.lang.NullPointerException
at com.alibaba.csp.sentinel.adapter.gateway.common.rule.GatewayRuleManager$GatewayRulePropertyListener.applyToConvertedParamMap(GatewayRuleManager.java:230)
at com.alibaba.csp.sentinel.adapter.gateway.common.rule.GatewayRuleManager$GatewayRulePropertyListener.applyGatewayRuleInternal(GatewayRuleManager.java:200)
at com.alibaba.csp.sentinel.adapter.gateway.common.rule.GatewayRuleManager$GatewayRulePropertyListener.configUpdate(GatewayRuleManager.java:118)
at com.alibaba.csp.sentinel.adapter.gateway.common.rule.GatewayRuleManager$GatewayRulePropertyListener.configUpdate(GatewayRuleManager.java:114)
at com.alibaba.csp.sentinel.property.DynamicSentinelProperty.updateValue(DynamicSentinelProperty.java:57)
at com.alibaba.csp.sentinel.adapter.gateway.common.rule.GatewayRuleManager.loadRules(GatewayRuleManager.java:78)
at com.alibaba.csp.sentinel.adapter.gateway.common.command.UpdateGatewayRuleCommandHandler.handle(UpdateGatewayRuleCommandHandler.java:59)
at com.alibaba.csp.sentinel.transport.command.http.HttpEventTask.run(HttpEventTask.java:103)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
### 这种情况如何规避才可更新成功
版本:
org.springframework.boot
spring-boot-starter-parent
2.2.5.RELEASE
pom
import
org.springframework.cloud
spring-cloud-dependencies
Hoxton.SR3
pom
import
com.alibaba.cloud
spring-cloud-alibaba-dependencies
2.2.3.RELEASE
pom
import
### 本地开发环境
### Anything else we need to know?
Contributor guide
Research direction
Start in GatewayRuleManager.java at lines 230, 200, 118, and 78, then trace the update path through UpdateGatewayRuleCommandHandler.java line 59. Reproduce a gateway flow-control rule update with the listed dependency versions and inspect the reported null-pointer path. Done means the rule update completes successfully without the NPE.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring-boot
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100