plugin/forward: remove dynamic read timeout (#2319)
* plugin/forward: remove dynamic read timeout We care about an upstream being there, so we still have a dynamic dial time out (by way higher then 200ms) of 1s; this should be fairly stable for an upstream. The read timeout if more variable because of cached and non cached responses. As such remove his logic entirely. Drop to 2s read timeout. Fixes #2306 Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
parent
e94ce7a12a
commit
a1d92c51cd
5 changed files with 15 additions and 26 deletions
|
@ -31,7 +31,7 @@ type Transport struct {
|
|||
|
||||
func newTransport(addr string) *Transport {
|
||||
t := &Transport{
|
||||
avgDialTime: int64(defaultDialTimeout / 2),
|
||||
avgDialTime: int64(maxDialTimeout / 2),
|
||||
conns: make(map[string][]*persistConn),
|
||||
expire: defaultExpire,
|
||||
addr: addr,
|
||||
|
@ -159,8 +159,10 @@ func (t *Transport) SetExpire(expire time.Duration) { t.expire = expire }
|
|||
func (t *Transport) SetTLSConfig(cfg *tls.Config) { t.tlsConfig = cfg }
|
||||
|
||||
const (
|
||||
defaultExpire = 10 * time.Second
|
||||
minDialTimeout = 100 * time.Millisecond
|
||||
maxDialTimeout = 30 * time.Second
|
||||
defaultDialTimeout = 30 * time.Second
|
||||
defaultExpire = 10 * time.Second
|
||||
minDialTimeout = 1 * time.Second
|
||||
maxDialTimeout = 30 * time.Second
|
||||
|
||||
// Some resolves might take quite a while, usually (cached) responses are fast. Set to 2s to give us some time to retry a different upstream.
|
||||
readTimeout = 2 * time.Second
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue