aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2016-11-27 15:24:50 +0000
committerGravatar Miek Gieben <miek@miek.nl> 2016-11-27 15:24:50 +0000
commit0876a38cd9e720c98372a13d8575df8f5f57daf5 (patch)
treeb883e47f92ae8f1c947af91ddfd3e8062a8bfd66
parent96222927a3309570b7ac7c618a28731f52845544 (diff)
downloadcoredns-0876a38cd9e720c98372a13d8575df8f5f57daf5.tar.gz
coredns-0876a38cd9e720c98372a13d8575df8f5f57daf5.tar.zst
coredns-0876a38cd9e720c98372a13d8575df8f5f57daf5.zip
middleware/httproxy: smaller timeouts
Make the timeouts smaller after we fail to connect.
-rw-r--r--middleware/httpproxy/google.go4
-rw-r--r--middleware/httpproxy/upstream.go2
2 files changed, 3 insertions, 3 deletions
diff --git a/middleware/httpproxy/google.go b/middleware/httpproxy/google.go
index 78b5ea864..72e8b5a7e 100644
--- a/middleware/httpproxy/google.go
+++ b/middleware/httpproxy/google.go
@@ -73,7 +73,7 @@ func (g *google) Exchange(req *dns.Msg) (*dns.Msg, error) {
timeout := addr.FailTimeout
if timeout == 0 {
- timeout = 10 * time.Second
+ timeout = 5 * time.Second
}
atomic.AddInt32(&addr.Fails, 1)
go func(host *proxy.UpstreamHost, timeout time.Duration) {
@@ -185,7 +185,7 @@ func (g *google) lookup(r *dns.Msg) ([]string, error) {
timeout := host.FailTimeout
if timeout == 0 {
- timeout = 10 * time.Second
+ timeout = 7 * time.Second
}
atomic.AddInt32(&host.Fails, 1)
go func(host *proxy.UpstreamHost, timeout time.Duration) {
diff --git a/middleware/httpproxy/upstream.go b/middleware/httpproxy/upstream.go
index f12de51fb..3342cce6f 100644
--- a/middleware/httpproxy/upstream.go
+++ b/middleware/httpproxy/upstream.go
@@ -22,7 +22,7 @@ func newSimpleUpstream(hosts []string) (*simpleUpstream, error) {
upstream := &simpleUpstream{
Hosts: nil,
Policy: &proxy.Random{},
- FailTimeout: 10 * time.Second,
+ FailTimeout: 3 * time.Second,
MaxFails: 3,
}