fix cluster proxy cleanup routing

This commit is contained in:
richjohnrambo
2026-09-24 10:18:07 +08:00
parent 9893452817
commit 75216c311d
3 changed files with 105 additions and 11 deletions
+3 -2
View File
@@ -7,6 +7,7 @@
package main
import (
"errors"
"net/http"
"time"
@@ -101,7 +102,7 @@ func (t *Topic) runProxy(hub *Hub) {
s.detachSession(t.name)
}
if err := globals.cluster.topicProxyGone(t.tenantID, t.name); err != nil {
if err := globals.cluster.topicProxyGone(t.tenantID, t.name); err != nil && !errors.Is(err, errClusterTopicOwnerUnavailable) {
logs.Warn.Printf("proxy topic[%s] shutdown: failed to notify master - %s", t.name, err)
}
@@ -164,7 +165,7 @@ func (t *Topic) handleProxyLeaveRequest(msg *ClientComMessage, killTimer *time.T
}
}
if err := globals.cluster.routeToTopicMaster(ProxyReqLeave, msg, t.name, msg.sess); err != nil {
if err := globals.cluster.routeToTopicMaster(ProxyReqLeave, msg, t.name, msg.sess); err != nil && !errors.Is(err, errClusterTopicOwnerUnavailable) {
logs.Warn.Printf("proxy topic[%s]: route leave request from proxy to master failed - %s", t.name, err)
}
if len(t.sessions) == 0 {