fix(loadbalance): prevent double-close panic in SlowStartManager.Stop()

Use atomic Swap instead of Load+close to prevent concurrent Stop()
calls from both passing the check and closing the channel twice.
This commit is contained in:
xfy 2026-06-03 01:07:22 +08:00
parent 332b96031b
commit ba0b3c55bb

View File

@ -105,7 +105,7 @@ func (m *SlowStartManager) Start() {
// Stop 停止后台更新。
func (m *SlowStartManager) Stop() {
if !m.running.Load() {
if !m.running.Swap(false) {
return
}
close(m.stopCh)