Refactor HostConnectionPool to a non-blocking implementation

Description

Currently, our connection pool is implemented with a condition queue (wait/notify) and blocks the calling thread when you try to borrow the connection with a timeout. The recommended workaround to avoid blocking is to set PoolingOptions.poolTimeoutMillis to 0.

Refactor the pool to avoid blocking.
borrowConnection should return a Future<Connection>. Instead of using a timeout, we should probably enqueue callers and expose a maximum queue size.

This will also allow us to chain the USE call when we need to change the keyspace on the connection, instead of blocking on it.

Environment

None

Pull Requests

None

Assignee

Unassigned

Reporter

Olivier Michallat

Labels

None

PM Priority

None

Affects versions

Fix versions

Pull Request

None

Doc Impact

None

Size

None

External issue ID

None

External issue ID

None

Priority

Major
Configure