Skip to content

Commit

Permalink
make liner happy
Browse files Browse the repository at this point in the history
  • Loading branch information
grcevski committed Aug 27, 2024
1 parent 2315251 commit b5a83f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pkg/export/prom/prom_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,8 @@ func TestTerminatesOnBadPromPort(t *testing.T) {
time.Sleep(5 * time.Second)
serverUp <- true
}()
server.ListenAndServe()
err := server.ListenAndServe()
fmt.Printf("Terminating server %v\n", err)
}()

sigChan := make(chan os.Signal, 1)
Expand Down
5 changes: 4 additions & 1 deletion pkg/internal/connector/prommgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ func (pm *PrometheusManager) listenAndServe(ctx context.Context, port int, handl
log.Debug("Prometheus endpoint server was closed", "error", err)
} else {
log.Error("Prometheus endpoint service ended unexpectedly", "error", err)
syscall.Kill(os.Getpid(), syscall.SIGINT) // interrupt for graceful shutdown, instead of os.Exit
err = syscall.Kill(os.Getpid(), syscall.SIGINT) // interrupt for graceful shutdown, instead of os.Exit
if err != nil {
log.Error("unable to terminate Beyla", "error", err)
}
}
}()
go func() {
Expand Down

0 comments on commit b5a83f5

Please sign in to comment.