Skip to content

Commit

Permalink
Skip trying to send system events just before shutdown
Browse files Browse the repository at this point in the history
Signed-off-by: Waldemar Quevedo <wally@nats.io>
  • Loading branch information
wallyqs committed May 20, 2024
1 parent 185e0fa commit 564db58
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,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
Expand Down

0 comments on commit 564db58

Please sign in to comment.