mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-02-09 15:27:11 +00:00
app/vminsert: do not pollute logs with repated cannot dial storageNode
errors
Log only the first error per -storageNode
This commit is contained in:
parent
0548f0c5c8
commit
bc37f1cbec
1 changed files with 9 additions and 1 deletions
|
@ -199,10 +199,15 @@ func (sn *storageNode) checkHealth() {
|
|||
}
|
||||
bc, err := sn.dial()
|
||||
if err != nil {
|
||||
logger.Warnf("cannot dial storageNode %q: %s", sn.dialer.Addr(), err)
|
||||
if sn.lastDialErr == nil {
|
||||
// Log the error only once.
|
||||
sn.lastDialErr = err
|
||||
logger.Warnf("cannot dial storageNode %q: %s", sn.dialer.Addr(), err)
|
||||
}
|
||||
return
|
||||
}
|
||||
logger.Infof("successfully dialed -storageNode=%q", sn.dialer.Addr())
|
||||
sn.lastDialErr = nil
|
||||
sn.bc = bc
|
||||
atomic.StoreUint32(&sn.broken, 0)
|
||||
}
|
||||
|
@ -371,6 +376,9 @@ type storageNode struct {
|
|||
|
||||
dialer *netutil.TCPDialer
|
||||
|
||||
// last error during dial.
|
||||
lastDialErr error
|
||||
|
||||
// The number of dial errors to vmstorage node.
|
||||
dialErrors *metrics.Counter
|
||||
|
||||
|
|
Loading…
Reference in a new issue