Skip to content

Commit

Permalink
Fix panic on /raftz when shutting down
Browse files Browse the repository at this point in the history
Signed-off-by: Neil Twigg <neil@nats.io>
  • Loading branch information
neilalexander committed Jul 18, 2024
1 parent fd284c8 commit 6bf686b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion server/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -3788,7 +3788,13 @@ func (s *Server) HandleRaftz(w http.ResponseWriter, r *http.Request) {
gfilter := r.URL.Query().Get("group")
afilter := r.URL.Query().Get("acc")
if afilter == "" {
afilter = s.SystemAccount().Name
if sys := s.SystemAccount(); sys != nil {
afilter = sys.Name
} else {
w.WriteHeader(404)
w.Write([]byte("System account not found, the server may be shutting down"))
return
}
}

groups := map[string]RaftNode{}
Expand Down

0 comments on commit 6bf686b

Please sign in to comment.