mochengqian commented on code in PR #963:
URL: https://github.com/apache/dubbo-go-pixiu/pull/963#discussion_r3371608828


##########
pkg/filter/llm/proxy/filter.go:
##########
@@ -133,9 +137,12 @@ type (
        }
 )
 
-// sharedCooldownStore keeps endpoint cooldowns process-wide so filter reloads
-// and multiple LLM proxy factories do not reset runtime failure state.
-var sharedCooldownStore = newCooldownStore()
+// newPlugin builds the plugin with its process-wide cooldown store, so every
+// filter factory the plugin creates shares one runtime failure state that
+// survives individual factory reloads.
+func newPlugin() *Plugin {
+       return &Plugin{cooldowns: newCooldownStore()}
+}

Review Comment:
    Added sync.Once to Plugin with a lazy cooldownStore() accessor. The 
implementation now matches the PR description's claim of "lazily owns 
(sync.Once)".



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to