mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-03-11 15:34:56 +00:00
lib/vmselectapi: properly check for net.ErrClosed
This error may be wrapped in another error, and should normally be tested using `errors.Is(err, net.ErrClosed)`. Signed-off-by: hagen1778 <roman@victoriametrics.com>
This commit is contained in:
parent
d677c2a5a6
commit
dde01c826d
1 changed files with 1 additions and 1 deletions
|
@ -257,7 +257,7 @@ func (s *Server) processConn(bc *handshake.BufferedConn) error {
|
|||
// Remote client gracefully closed the connection.
|
||||
return nil
|
||||
}
|
||||
if err == net.ErrClosed || strings.Contains(err.Error(), "broken pipe") {
|
||||
if errors.Is(err, net.ErrClosed) || strings.Contains(err.Error(), "broken pipe") {
|
||||
// The connection has been interrupted abruptly.
|
||||
// It could happen due to unexpected network glitch or because connection was
|
||||
// interrupted by remote client. In both cases, remote client will notice
|
||||
|
|
Loading…
Reference in a new issue