fix: absorb multiplex close bursts

This commit is contained in:
richjohnrambo
2026-10-02 15:53:03 +08:00
parent a406d63154
commit 80808349fb
4 changed files with 238 additions and 0 deletions
+2
View File
@@ -1401,8 +1401,10 @@ func (sess *Session) clusterWriteLoop(forTopic string) {
// The topic may retain this multiplexing session briefly while its
// unsubscribe request is processed. Reject writes to the stale session
// instead of filling a send queue which no longer has a drain owner.
sess.clusterQueueMu.Lock()
atomic.StoreInt32(&sess.terminating, 1)
sess.purgeChannels()
sess.clusterQueueMu.Unlock()
sess.closeRPC()
globals.sessionStore.Delete(sess)
sess.inflightReqs = nil