Skip to content

Commit

Permalink
Adds additional logging around connection validation to temporal-cass…
Browse files Browse the repository at this point in the history
…andra-tool

We noticed a few instances where the temporal-cassandra-tool is taking a long time to apply schema updates. We suspect this is because testing connection establishment is taking quite a while, but we do not have any logs around this. This PR adds logs to better diagnose this.
  • Loading branch information
mastermanu committed Apr 9, 2021
1 parent 6b0d5ec commit ca6febf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/cassandra/cqlclient.go
Expand Up @@ -105,10 +105,14 @@ func newCQLClient(cfg *CQLClientConfig) (*cqlClient, error) {

cassandraConfig := cfg.toCassandraConfig()
cassandraConfig.ConnectTimeout = time.Duration(cfg.Timeout) * time.Second

log.Println("validating connection to cassandra cluster")
session, err := gocql.NewSession(*cassandraConfig, resolver.NewNoopResolver())
if err != nil {
log.Printf("connection validation failed: %+v\r\n", err)
return nil, err
}
log.Println("connection validation succeeded")

return &cqlClient{
keyspace: cfg.Keyspace,
Expand Down

0 comments on commit ca6febf

Please sign in to comment.