Skip to content

Commit

Permalink
Merge pull request #170 from GeoNet/gocqlBug
Browse files Browse the repository at this point in the history
fix: set DisableInitialHostLookup to false
  • Loading branch information
sue-h-gns authored May 24, 2024
2 parents 0885288 + 697593f commit 89e8bae
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions aws/keyspaces/keyspaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ func New(host, certPath string) (Keyspaces, error) {
cluster := gocql.NewCluster(host)
ksClient.cluster = cluster

// Set port.
cluster.Port = 9142

// When host is localhost, for example in a test environment, we don't need these settings.
if host != "localhost" {
authenticator, err := generateAuthenticator()
Expand All @@ -68,8 +71,11 @@ func New(host, certPath string) (Keyspaces, error) {
}
// Override default Consistency to LocalQuorum
cluster.Consistency = gocql.LocalQuorum
// Disable initial host lookup
cluster.DisableInitialHostLookup = true

// Enable initial host lookup.
// see https://github.com/gocql/gocql/issues/915
// When set to true, we were seeing this error intermittently.
cluster.DisableInitialHostLookup = false
}

// Create session.
Expand Down

0 comments on commit 89e8bae

Please sign in to comment.