@@ -51,14 +51,28 @@ type ClusterConfig struct {
5151 // versions the protocol selected is not defined (ie, it can be any of the supported in the cluster)
5252 ProtoVersion int
5353
54- // Connection timeout (default: 600ms)
55- // ConnectTimeout is used to set up the default dialer and is ignored if Dialer or HostDialer is provided.
54+ // Timeout limits the time spent on the client side while executing a query.
55+ // Specifically, query or batch execution will return an error if the client does not receive a response
56+ // from the server within the Timeout period.
57+ // Timeout is also used to configure the read timeout on the underlying network connection.
58+ // Client Timeout should always be higher than the request timeouts configured on the server,
59+ // so that retries don't overload the server.
60+ // Timeout has a default value of 11 seconds, which is higher than default server timeout for most query types.
61+ // Timeout is not applied to requests during initial connection setup, see ConnectTimeout.
5662 Timeout time.Duration
5763
58- // Initial connection timeout, used during initial dial to server (default: 600ms)
64+ // ConnectTimeout limits the time spent during connection setup.
65+ // During initial connection setup, internal queries, AUTH requests will return an error if the client
66+ // does not receive a response within the ConnectTimeout period.
67+ // ConnectTimeout is applied to the connection setup queries independently.
68+ // ConnectTimeout also limits the duration of dialing a new TCP connection
69+ // in case there is no Dialer nor HostDialer configured.
70+ // ConnectTimeout has a default value of 11 seconds.
5971 ConnectTimeout time.Duration
6072
61- // Timeout for writing a query. Defaults to Timeout if not specified.
73+ // WriteTimeout limits the time the driver waits to write a request to a network connection.
74+ // WriteTimeout should be lower than or equal to Timeout.
75+ // WriteTimeout defaults to the value of Timeout.
6276 WriteTimeout time.Duration
6377
6478 // Port used when dialing.
@@ -244,8 +258,8 @@ func NewCluster(hosts ...string) *ClusterConfig {
244258 cfg := & ClusterConfig {
245259 Hosts : hosts ,
246260 CQLVersion : "3.0.0" ,
247- Timeout : 600 * time .Millisecond ,
248- ConnectTimeout : 600 * time .Millisecond ,
261+ Timeout : 11 * time .Second ,
262+ ConnectTimeout : 11 * time .Second ,
249263 Port : 9042 ,
250264 NumConns : 2 ,
251265 Consistency : Quorum ,
0 commit comments