scylladb / gocql

Package gocql implements a fast and robust ScyllaDB client for the Go programming language.

Home Page:https://docs.scylladb.com/stable/using-scylla/drivers/cql-drivers/scylla-go-driver.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SingleHostExecutor() doesn't close the connection properly

karol-kokoszka opened this issue · comments

Please answer these questions before submitting your issue. Thanks!

What version of Scylla or Cassandra are you using?

Scylla Enterprise 2022.1.0

What version of Gocql are you using?

github.com/scylladb/gocql v1.5.1-0.20210906110332-fb22d64efc33

What version of Go are you using?

go1.19

What did you do?

Added credentials to scylla manager so that the healthcheck service uses SingleHostExecutor() that executes simple CQL query SELECT now() FROM system.local on the node.
Afterwards, manager closes the connection with Close() method.

See https://github.com/scylladb/scylla-manager/blob/e25e51487cae81fc04eb67fa5b957249a4ac6801/pkg/ping/cqlping/cqlping.go#L148-L157

What did you expect to see?

I expect to see that the connection is closed.

What did you see instead?

I see that connection leaks and manager keep increasing number of opened connections to the node.
More details here https://github.com/scylladb/scylla-enterprise/issues/2965


If you are having connectivity related issues please share the following additional information

Describe your Cassandra cluster

please provide the following information

  • output of nodetool status
  • output of SELECT peer, rpc_address FROM system.peers
  • rebuild your application with the gocql_debug tag and post the output

Did you try with newer Go driver version?

I didn't manage to reproduce it locally even with the driver that manager is currently using.
Local env doesn't include TLS.
I'll try with cloud deployment and will observe its behavior in time.