Skip to content

Commit

Permalink
fix nrpe handling connections serial
Browse files Browse the repository at this point in the history
  • Loading branch information
sni committed Nov 22, 2023
1 parent 15fcb1b commit f88539b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/snclient/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,12 @@ func (l *Listener) startListenerTCP(handler RequestHandlerTCP) {
return
}

l.handleTCPCon(con, handler)
go func(con net.Conn) {
// log panices during request, but continue listening
defer l.snc.logPanicRecover()

l.handleTCPCon(con, handler)
}(con)
}
}

Expand Down Expand Up @@ -433,6 +438,9 @@ func (l *Listener) BindString() string {
func (l *Listener) WrappedHTTPHandler(next http.Handler, res http.ResponseWriter, req *http.Request) {
startTime := time.Now()

// log panices during request, but continue listening
defer l.snc.logPanicRecover()

if log.IsV(LogVerbosityTrace) {
reqStr, err := httputil.DumpRequest(req, true)
if err != nil {
Expand Down

0 comments on commit f88539b

Please sign in to comment.