fix(agent): retire replaced tunnel sessions (#541)

This commit is contained in:
sagit
2026-08-07 14:35:30 +08:00
committed by GitHub
parent 9e6f80019d
commit 0b23d6f7d7
22 changed files with 701 additions and 19 deletions
+7 -1
View File
@@ -28,7 +28,13 @@ func (r *chainRegistry) Register(name string, v chain.Chainer) error {
}
func (r *chainRegistry) replace(name string, v chain.Chainer) {
r.m.Store(name, v)
old, loaded := r.m.Swap(name, v)
if !loaded {
return
}
if retirer, ok := old.(interface{ Retire() }); ok {
retirer.Retire()
}
}
func (r *chainRegistry) Get(name string) chain.Chainer {