Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set Cassandra connect timeout, not just regular timeout #12903

Merged
merged 2 commits into from Oct 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions 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
```
1 change: 1 addition & 0 deletions plugins/database/cassandra/connection_producer.go
Expand Up @@ -189,6 +189,7 @@ func (c *cassandraConnectionProducer) createSession(ctx context.Context) (*gocql
}

clusterConfig.Timeout = c.connectTimeout
clusterConfig.ConnectTimeout = c.connectTimeout
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable to me. I see that ClusterConfig.Timeout and ClusterConfig.ConnectTimeout are set to the same value in NewCluster().

I suppose we could easily decouple this in the future.

clusterConfig.SocketKeepalive = c.socketKeepAlive
clusterConfig.SslOpts = c.sslOpts

Expand Down
3 changes: 2 additions & 1 deletion website/content/api-docs/secret/databases/cassandra.mdx
Expand Up @@ -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
Expand Down