Skip to content

Discard new connections when keyspace setup fails #1682

@dkropachev

Description

@dkropachev

When setting the keyspace on a newly opened connection fails, the pool logs the error but still reports the ready connection as successful with a keyspace attached.

Code permalink:

let result = connection.use_keyspace(&keyspace_name).await;

The ready-connection handler can then accept and publish a connection as if the current keyspace was installed. Later unqualified queries may run with no keyspace, or with the wrong keyspace, instead of retrying or discarding that connection.

Suggested direction: treat keyspace setup failure as a connection setup failure, so the pool retries or drops the connection rather than publishing it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai-assistedarea/connectingOpening new connections, managing connection pool.bugSomething isn't workinggood first issueGood for newcomers

    Type

    No fields configured for Bug.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions