cql-proxy icon indicating copy to clipboard operation
cql-proxy copied to clipboard

Fix connection leak of session with dropped keyspace

Open ikehara opened this issue 7 months ago • 5 comments

This PR fixes the connection leak problem of reconnection failure.

When a keyspace is dropped and the origin server is restarted, cql-proxy attempts to reconnect. However, the new connection fails to set the keyspace, leading to a memory leak each time cql-proxy tries to connect to the server.

2024-06-29T17:23:48.232+0900	INFO	proxycore/connpool.go:193	pool connection attempting to reconnect after delay	{"host": "127.0.0.1:9042", "delay": "10s"}

The root cause of this issue is that the connection cleanup process is not functioning as expected. Specifically, the conn variable is always nil because the statement return nil, err overwrites the conn variable.

ikehara avatar Jun 29 '24 08:06 ikehara