app/vmagent: properly initialize stdDialer

This is a follow-up commit for 7da20a4b3f

Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1699
This commit is contained in:
Aliaksandr Valialkin 2022-04-06 13:56:35 +03:00
parent 50cf74ce4b
commit 569b0d444c
No known key found for this signature in database
GPG key ID: A72BEC6CD3D0DED1

View file

@ -29,7 +29,8 @@ var (
func statDial(ctx context.Context, networkUnused, addr string) (conn net.Conn, err error) { func statDial(ctx context.Context, networkUnused, addr string) (conn net.Conn, err error) {
network := netutil.GetTCPNetwork() network := netutil.GetTCPNetwork()
conn, err = stdDialer.DialContext(ctx, network, addr) d := getStdDialer()
conn, err = d.DialContext(ctx, network, addr)
dialsTotal.Inc() dialsTotal.Inc()
if err != nil { if err != nil {
dialErrors.Inc() dialErrors.Inc()