From b8e98fd546cdcf23159c18e89fbbe44c7fb59989 Mon Sep 17 00:00:00 2001 From: Vladimir Dementyev Date: Thu, 31 Oct 2024 12:12:22 -0700 Subject: [PATCH] fix: remove sessions from hub during shutdown Prevent misleading failed_server_msg metric growth happening during shutdown --- node/node.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/node/node.go b/node/node.go index 8a5f4cb0..80f12355 100644 --- a/node/node.go +++ b/node/node.go @@ -696,6 +696,10 @@ func (n *Node) Disconnect(s *Session) error { } if n.IsShuttingDown() { + // Make sure session is removed from hub, so we don't try to send + // broadcast messages to them + n.hub.RemoveSession(s) + if s.IsDisconnectable() { return n.DisconnectNow(s) }