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

Status

Assignee

Unassigned

Reporter

Olivier Michallat

Labels

None

PM Priority

None

Reproduced in

None

External issue ID

None

External issue ID

None

External issue ID

None

External issue ID

None

External issue ID

None

External issue ID

None

Doc Impact

None

Reviewer

None

Size

None

Fix versions

Affects versions

2.0.10.1

Priority

Major
Configure