Merge pull request #1064 from andyxning/check_for_monitor_server_start_error

check for monitor server start error
This commit is contained in:
Derek Collison
2019-07-10 21:00:23 -07:00
committed by GitHub

View File

@@ -1471,7 +1471,14 @@ func (s *Server) startMonitoring(secure bool) error {
s.mu.Unlock()
go func() {
srv.Serve(httpListener)
if err := srv.Serve(httpListener); err != nil {
s.mu.Lock()
shutdown := s.shutdown
s.mu.Unlock()
if !shutdown {
s.Fatalf("Error starting monitor on %q: %v", hp, err)
}
}
srv.Handler = nil
s.mu.Lock()
s.httpHandler = nil