From 466cb1f9e8ef6410bddeffba9b6cbfada02a4fc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E8=BF=9B?= Date: Sun, 25 Oct 2026 23:11:58 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E9=99=90=E6=B5=81=E7=BB=84=E4=B8=8E=E9=94=99=E8=AF=AF=E5=88=86?= =?UTF-8?q?=E7=B1=BB=E8=A7=84=E5=88=99=E5=90=8E=E7=BC=93=E5=AD=98=E5=A4=B1?= =?UTF-8?q?=E6=95=88=E5=87=BD=E6=95=B0=E6=97=A0=E9=99=90=E9=80=92=E5=BD=92?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=20API=20=E6=A0=88=E6=BA=A2=E5=87=BA=E5=B4=A9?= =?UTF-8?q?=E6=BA=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit invalidateGroups、invalidateRules 误写为调用自身,任何限流组或错误分类规则保存成功后 API 进程栈溢出退出;改为调用限流组与分类器的 Invalidate --- internal/service/polling/gateway_rate_limit_service.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/service/polling/gateway_rate_limit_service.go b/internal/service/polling/gateway_rate_limit_service.go index 40240da1..653dca68 100644 --- a/internal/service/polling/gateway_rate_limit_service.go +++ b/internal/service/polling/gateway_rate_limit_service.go @@ -645,14 +645,14 @@ func uintString(value uint) string { // invalidateGroups 让本进程限流组缓存立即失效;其他进程在缓存时长(数秒)内自动刷新。 func (s *GatewayRateLimitService) invalidateGroups() { - if s.runtime != nil { - s.invalidateGroups() + if s.runtime != nil && s.runtime.Groups != nil { + s.runtime.Groups.Invalidate() } } // invalidateRules 让本进程错误分类规则缓存立即失效。 func (s *GatewayRateLimitService) invalidateRules() { - if s.runtime != nil { - s.invalidateRules() + if s.runtime != nil && s.runtime.Classifier != nil { + s.runtime.Classifier.Invalidate() } }