Don't set block profile rate

Signed-off-by: Neil Twigg <neil@nats.io>
This commit is contained in:
Neil Twigg
2023-08-16 17:00:07 +01:00
parent 7670cf581c
commit 19397a5683

View File

@@ -2093,9 +2093,6 @@ func (s *Server) Start() {
// Pprof http endpoint for the profiler.
if opts.ProfPort != 0 {
s.StartProfiler()
} else {
// Enable blocking profile even if no port defined since profiling is always possible over $SYS requests
runtime.SetBlockProfileRate(1)
}
if opts.ConfigFile != _EMPTY_ {
@@ -2697,9 +2694,6 @@ func (s *Server) StartProfiler() {
s.profiler = l
s.profilingServer = srv
// Enable blocking profile
runtime.SetBlockProfileRate(1)
go func() {
// if this errors out, it's probably because the server is being shutdown
err := srv.Serve(l)