mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-03-11 15:34:56 +00:00
lib/vmselectapi: extend error handling to ignore "reset by peer"
This is a followup for https://github.com/VictoriaMetrics/VictoriaMetrics/pull/4418 to also handle "connection reset by peer" errors in connection handling logic. This error can be triggered just the same as described in original PR: when query was closed on vmselect side and connection has been interrupted. Signed-off-by: Zakhar Bessarab <z.bessarab@victoriametrics.com>
This commit is contained in:
parent
88ac6116bd
commit
830dac177f
1 changed files with 3 additions and 1 deletions
|
@ -257,7 +257,9 @@ func (s *Server) processConn(bc *handshake.BufferedConn) error {
|
||||||
// Remote client gracefully closed the connection.
|
// Remote client gracefully closed the connection.
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if errors.Is(err, net.ErrClosed) || strings.Contains(err.Error(), "broken pipe") {
|
if errors.Is(err, net.ErrClosed) ||
|
||||||
|
strings.Contains(err.Error(), "broken pipe") ||
|
||||||
|
strings.Contains(err.Error(), "connection reset by peer") {
|
||||||
// The connection has been interrupted abruptly.
|
// The connection has been interrupted abruptly.
|
||||||
// It could happen due to unexpected network glitch or because connection was
|
// It could happen due to unexpected network glitch or because connection was
|
||||||
// interrupted by remote client. In both cases, remote client will notice
|
// interrupted by remote client. In both cases, remote client will notice
|
||||||
|
|
Loading…
Reference in a new issue