From d1bb2b786cd1d5471d99e8232fa840e48cb2cefe Mon Sep 17 00:00:00 2001 From: Nick Cabatoff Date: Fri, 22 Oct 2021 10:12:18 -0400 Subject: [PATCH 1/2] It looks like Cassandra sessions have both a "connect timeout" that governs timeouts when initiating connections, and a regular timeout used post-initialization. Our connection producer also has a "connect timeout", but only uses it for setting the latter. I think we should use it for both timeouts. --- plugins/database/cassandra/connection_producer.go | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/database/cassandra/connection_producer.go b/plugins/database/cassandra/connection_producer.go index 423ca69888636..db8ea4f64c139 100644 --- a/plugins/database/cassandra/connection_producer.go +++ b/plugins/database/cassandra/connection_producer.go @@ -189,6 +189,7 @@ func (c *cassandraConnectionProducer) createSession(ctx context.Context) (*gocql } clusterConfig.Timeout = c.connectTimeout + clusterConfig.ConnectTimeout = c.connectTimeout clusterConfig.SocketKeepalive = c.socketKeepAlive clusterConfig.SslOpts = c.sslOpts From 66e6b67d28d90eafbafc9be13aab7a88f16baccd Mon Sep 17 00:00:00 2001 From: Nick Cabatoff Date: Fri, 22 Oct 2021 10:34:14 -0400 Subject: [PATCH 2/2] Add CL and update docs. --- changelog/12903.txt | 3 +++ website/content/api-docs/secret/databases/cassandra.mdx | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 changelog/12903.txt diff --git a/changelog/12903.txt b/changelog/12903.txt new file mode 100644 index 0000000000000..f14762dce1936 --- /dev/null +++ b/changelog/12903.txt @@ -0,0 +1,3 @@ +```release-note:improvement +db/cassandra: make the connect_timeout config option actually apply to connection timeouts, in addition to non-connection operations +``` \ No newline at end of file diff --git a/website/content/api-docs/secret/databases/cassandra.mdx b/website/content/api-docs/secret/databases/cassandra.mdx index 2bc0cb84d2fe9..482cce026faab 100644 --- a/website/content/api-docs/secret/databases/cassandra.mdx +++ b/website/content/api-docs/secret/databases/cassandra.mdx @@ -78,7 +78,8 @@ vault write database/config/cassandra-example <...other fields> pem_json=@/path/ - `protocol_version` `(int: 2)` – Specifies the CQL protocol version to use. -- `connect_timeout` `(string: "5s")` – Specifies the connection timeout to use. +- `connect_timeout` `(string: "5s")` – Specifies the timeout to use, both for + connections and in general. - `local_datacenter` `(string: "")` – If set, enables host selection policy which will prioritize and use hosts which are in the local datacenter before