From 45f9f3c539846aadde7582f2dfc4814cd72a2884 Mon Sep 17 00:00:00 2001 From: Callum Styan Date: Fri, 20 Oct 2017 08:56:30 -0700 Subject: [PATCH] use a timeout in the HTTP client used for consul sd (#3303) --- discovery/consul/consul.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/discovery/consul/consul.go b/discovery/consul/consul.go index 38f3f8836..d782a2722 100644 --- a/discovery/consul/consul.go +++ b/discovery/consul/consul.go @@ -114,7 +114,10 @@ func NewDiscovery(conf *config.ConsulSDConfig, logger log.Logger) (*Discovery, e conntrack.DialWithName("consul_sd"), ), } - wrapper := &http.Client{Transport: transport} + wrapper := &http.Client{ + Transport: transport, + Timeout: 30 * time.Second, + } clientConf := &consul.Config{ Address: conf.Server,