mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-01-20 07:19:17 +01:00
lib/netutil: parallelize background pings for remote addresses
This should improve the time needed for determining unavailale remote addresses
across big numer of ConnPool's.
This is a follow-up for a1629bd3be
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/711
This commit is contained in:
parent
24097f2417
commit
288d13af8d
@ -222,8 +222,14 @@ var connPools []*ConnPool
|
||||
|
||||
func forEachConnPool(f func(cp *ConnPool)) {
|
||||
connPoolsMu.Lock()
|
||||
var wg sync.WaitGroup
|
||||
for _, cp := range connPools {
|
||||
f(cp)
|
||||
wg.Add(1)
|
||||
go func(cp *ConnPool) {
|
||||
defer wg.Done()
|
||||
f(cp)
|
||||
}(cp)
|
||||
}
|
||||
wg.Wait()
|
||||
connPoolsMu.Unlock()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user