mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-15 00:13:30 +01:00
app/vmselect/netstorage: properly detect and log timeout errors when querying vmstorage from vmselect
This change is based on https://github.com/VictoriaMetrics/VictoriaMetrics/pull/2937 Thanks to @isodude for the initial pull request.
This commit is contained in:
parent
a2ecf311b8
commit
2635211bf4
@ -9,6 +9,7 @@ import (
|
||||
"math/rand"
|
||||
"net"
|
||||
"net/http"
|
||||
"os"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
@ -1728,7 +1729,7 @@ func (sn *storageNode) execOnConn(qt *querytracer.Tracer, funcName string, f fun
|
||||
// since it may be broken.
|
||||
_ = bc.Close()
|
||||
}
|
||||
if deadline.Exceeded() {
|
||||
if deadline.Exceeded() || errors.Is(err, os.ErrDeadlineExceeded) {
|
||||
return fmt.Errorf("cannot execute funcName=%q on vmstorage %q with timeout %s: %w", funcName, remoteAddr, deadline.String(), err)
|
||||
}
|
||||
return fmt.Errorf("cannot execute funcName=%q on vmstorage %q: %w", funcName, remoteAddr, err)
|
||||
|
Loading…
Reference in New Issue
Block a user