@@ -1042,9 +1042,9 @@ func (c *Client) httpRequest(method string, path string, data []byte, headers ma
1042
1042
var response * http.Response
1043
1043
var err error
1044
1044
for i := 0 ; i < maxHosts ; i ++ {
1045
- host , err := c .host (useCoordinator )
1046
- if err != nil {
1047
- return nil , nil , err
1045
+ host , herr := c .host (useCoordinator )
1046
+ if herr != nil {
1047
+ return nil , nil , errors . Wrapf ( herr , "getting host, previous err: %v" , err )
1048
1048
}
1049
1049
response , err = c .doRequest (host , method , path , c .augmentHeaders (headers ), data )
1050
1050
if err == nil {
@@ -1056,14 +1056,15 @@ func (c *Client) httpRequest(method string, path string, data []byte, headers ma
1056
1056
c .coordinatorURI = nil
1057
1057
c .coordinatorLock .Unlock ()
1058
1058
} else {
1059
+ c .logger .Printf ("removing host due to '%v'\n " , err )
1059
1060
c .cluster .RemoveHost (host )
1060
1061
}
1061
1062
}
1062
1063
// TODO: exponential backoff
1063
1064
time .Sleep (1 * time .Second )
1064
1065
}
1065
1066
if response == nil {
1066
- return nil , nil , ErrTriedMaxHosts
1067
+ return nil , nil , errors . Wrap ( err , ErrTriedMaxHosts . Error ())
1067
1068
}
1068
1069
defer response .Body .Close ()
1069
1070
warning := response .Header .Get ("warning" )
@@ -1693,10 +1694,10 @@ func (co *ClientOptions) withDefaults() (updated *ClientOptions) {
1693
1694
updated .ConnectTimeout = time .Second * 60
1694
1695
}
1695
1696
if updated .PoolSizePerRoute <= 0 {
1696
- updated .PoolSizePerRoute = 10
1697
+ updated .PoolSizePerRoute = 50
1697
1698
}
1698
1699
if updated .TotalPoolSize <= 0 {
1699
- updated .TotalPoolSize = 100
1700
+ updated .TotalPoolSize = 500
1700
1701
}
1701
1702
if updated .TLSConfig == nil {
1702
1703
updated .TLSConfig = & tls.Config {}
0 commit comments