Skip to content

Commit e839990

Browse files
committed
check for monitor server start error
1 parent 94071d3 commit e839990

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

server/server.go

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

14731473
go func() {
1474-
srv.Serve(httpListener)
1474+
err := srv.Serve(httpListener)
1475+
if err != nil {
1476+
s.Fatalf("Error starting monitor on %q: %v", hp, err)
1477+
}
14751478
srv.Handler = nil
14761479
s.mu.Lock()
14771480
s.httpHandler = nil

server/server_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -1162,6 +1162,8 @@ func TestConnectErrorReports(t *testing.T) {
11621162

11631163
remoteURLs := RoutesFromStr("nats://127.0.0.1:1234")
11641164

1165+
s.Shutdown()
1166+
11651167
opts = DefaultOptions()
11661168
opts.ConnectErrorReports = 3
11671169
opts.Cluster.Port = -1

0 commit comments

Comments
 (0)