From c9808f8de0c3cd15d45c10c792c510a84bad944f Mon Sep 17 00:00:00 2001 From: Neil Twigg Date: Tue, 21 May 2024 16:57:19 +0100 Subject: [PATCH 1/2] Add goroutine annotation for stream internal loop Signed-off-by: Neil Twigg --- server/stream.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/stream.go b/server/stream.go index b3add51cc71..6ed1792e350 100644 --- a/server/stream.go +++ b/server/stream.go @@ -4870,6 +4870,10 @@ func (mset *stream) name() string { func (mset *stream) internalLoop() { mset.mu.RLock() + setGoRoutineLabels(pprofLabels{ + "account": mset.acc.Name, + "stream": mset.cfg.Name, + }) s := mset.srv c := s.createInternalJetStreamClient() c.registerWithAccount(mset.acc) From 6427a459771967b2e72ed4e320318fcf3b73a824 Mon Sep 17 00:00:00 2001 From: Waldemar Quevedo Date: Mon, 20 May 2024 14:43:41 -0700 Subject: [PATCH 2/2] Skip trying to send system events just before shutdown Signed-off-by: Waldemar Quevedo --- server/events.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/events.go b/server/events.go index 3e257eab775..d165b9ef204 100644 --- a/server/events.go +++ b/server/events.go @@ -632,6 +632,11 @@ func (s *Server) sendInternalAccountMsgWithReply(a *Account, subject, reply stri s.mu.RLock() if s.sys == nil || s.sys.sendq == nil { s.mu.RUnlock() + if s.isShuttingDown() { + // Skip in case this was called at the end phase during shut down + // to avoid too many entries in the logs. + return nil + } return ErrNoSysAccount } c := s.sys.client