Skip to content

Commit b868e91

Browse files
Merge pull request #1064 from andyxning/check_for_monitor_server_start_error
check for monitor server start error
2 parents 00d8d08 + c9221fd commit b868e91

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

server/server.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -1471,7 +1471,14 @@ func (s *Server) startMonitoring(secure bool) error {
14711471
s.mu.Unlock()
14721472

14731473
go func() {
1474-
srv.Serve(httpListener)
1474+
if err := srv.Serve(httpListener); err != nil {
1475+
s.mu.Lock()
1476+
shutdown := s.shutdown
1477+
s.mu.Unlock()
1478+
if !shutdown {
1479+
s.Fatalf("Error starting monitor on %q: %v", hp, err)
1480+
}
1481+
}
14751482
srv.Handler = nil
14761483
s.mu.Lock()
14771484
s.httpHandler = nil

0 commit comments

Comments
 (0)