"io"
"io/ioutil"
"log"
+ "net"
"net/http"
"regexp"
"strings"
Arvados: arv,
Want_replicas: 2,
Using_proxy: false,
- Client: &http.Client{Transport: &http.Transport{}}}
+ Client: &http.Client{
+ // The maximum duration of the connection, will be
+ // closed if exceeded.
+ Timeout: 5 * time.Minute,
+ Transport: &http.Transport{
+ Dial: (&net.Dialer{
+ // The maximum time to wait to set up
+ // the initial TCP connection.
+ Timeout: 60 * time.Second,
+
+ // The TCP keep alive heartbeat
+ // interval.
+ KeepAlive: 60 * time.Second,
+ }).Dial,
+ TLSHandshakeTimeout: 10 * time.Second,
+ }}}
err = (&kc).DiscoverKeepServers()
"io"
"io/ioutil"
"log"
+ "net"
"net/http"
"os"
"strings"
this.SetServiceRoots(sr)
this.Using_proxy = true
if this.Client.Timeout == 0 {
- this.Client.Timeout = 10 * time.Minute
+ // See MakeKeepClient for notes on meaning of timeouts.
+ this.Client.Timeout = 300 * time.Second
+ this.Client.Transport = &http.Transport{
+ Dial: (&net.Dialer{
+ Timeout: 30 * time.Second,
+ KeepAlive: 60 * time.Second,
+ }).Dial,
+ TLSHandshakeTimeout: 10 * time.Second,
+ }
}
return nil
}
if this.Client.Timeout == 0 {
- this.Client.Timeout = 15 * time.Second
+ // See MakeKeepClient for notes on meaning of timeouts.
+ this.Client.Timeout = 20 * time.Second
+ this.Client.Transport = &http.Transport{
+ Dial: (&net.Dialer{
+ Timeout: 2 * time.Second,
+ KeepAlive: 60 * time.Second,
+ }).Dial,
+ TLSHandshakeTimeout: 10 * time.Second,
+ }
}
type svcList struct {