fix: stop writes to closed cluster sessions
This commit is contained in:
@@ -1398,6 +1398,11 @@ func (sess *Session) clusterWriteLoop(forTopic string) {
|
||||
terminate := true
|
||||
defer func() {
|
||||
if terminate {
|
||||
// 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.
|
||||
atomic.StoreInt32(&sess.terminating, 1)
|
||||
sess.purgeChannels()
|
||||
sess.closeRPC()
|
||||
globals.sessionStore.Delete(sess)
|
||||
sess.inflightReqs = nil
|
||||
|
||||
Reference in New Issue
Block a user