apache / apache/cassandra-gocql-driver
after upgrade logon takes too long (ConnectTimeout)
- Dominant language
- Go
- Stars
- 2.7k
- Forks
- 658
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I have found an issue when using an non-default ConnectTimeout. In my program I have set it to 4 minutes long time ago and it was running fine. Since upgrading gocql to the latest version the connection takes >15 minutes!
When setting ConnectTimeout to 10 seconds, the logon takes ~1 minute, when setting it to 2 secs, the logon takes 15secs, when defaulting it it takes ~5 secs.
There are NO failures, only the logon takes too long.
Using a 9-node cluster with cassandra 3.0.8. under ubuntu 14.04.
Here is a sample program:
gocql.TimeoutLimit = 100 // does not seem to have influence on logon delay
nodenames := []string{""}
fmt.Printf("Connecting to database: %s...\n", nodenames)
ClusterConfig := gocql.NewCluster(nodenames...)
ClusterConfig.Consistency = gocql.Quorum
ClusterConfig.ConnectTimeout = time.Duration(240) * time.Second // logon takes several minutes depending on that value ?!
ClusterConfig.Authenticator = gocql.PasswordAuthenticator{Username: "YYY", Password: "XXX"}
fmt.Println("starting NewSession...")
if session, err := gocql.NewSession(*ClusterConfig); err != nil { // NewSession runs for several minutes with nondefault ConnectTimeout
panic(err)
} else {
fmt.Println("Connected.")
session.Query("select somecol from sometab;").Scan()
}
Contributor guide
Research direction
Start by reproducing the delay with the sample program, focusing on NewSession and the non-default ClusterConfig.ConnectTimeout against the described Cassandra 3.0.8 cluster. Compare connection timing for the listed timeout values; done means the excessive logon delay is resolved or its cause is clearly identified and verified across those cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cassandra, go
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100