VictoriaMetrics/lib/netutil
Aliaksandr Valialkin a1629bd3be
lib/netutil.ConnPool: skip dialing remote address if the previous dial attempt was unsuccessful
If the previous dial attempt was unsuccessful, then all the new dial attempts are skipped
until the background goroutine determines that the given address can be successfully dialed.

This reduces query latency when some of vmstorage nodes are unavailable and dialing them is slow.

This should help with https://github.com/VictoriaMetrics/VictoriaMetrics/issues/711

This commit is based on ideas from the https://github.com/VictoriaMetrics/VictoriaMetrics/pull/2756

The main differences are:

- The check for healthy/unhealthy storage nodes is moved one level lower from app/vmselect/netstorage to lib/netutil.ConnPool.
  This makes possible re-using this feature everywhere lib/netutil.ConnPool is used.
- The check doesn't take into account handshake errors for already established connections.
  Handshake errors usually mean improperly configured VictoriaMetrics cluster, so they shouldn't be ignored.
2022-06-20 17:33:54 +03:00
..
conn_pool.go lib/netutil.ConnPool: skip dialing remote address if the previous dial attempt was unsuccessful 2022-06-20 17:33:54 +03:00
conn.go all: use errors.As instead of type assertion for detecting net.Error 2020-07-01 00:16:13 +03:00
tcpdialer.go app/{vminsert,vmselect}: add -vmstorageDialTimeout command-line flag for tuning the maximum time needed for establishing connections to vmstorage 2022-06-20 15:17:34 +03:00
tcplistener.go lib/httpserver: extract the code responsible for initializing server-side TLS config into netutil.GetServerTLSConfig 2022-03-17 19:46:20 +02:00
tls_test.go lib/httpserver: follow up after def0032c7d 2022-04-16 15:52:44 +03:00
tls.go app/vmstorage: add support for mTLS cipher suites via -cluster.tlsCipherSuites command-line flag 2022-04-16 16:36:38 +03:00