-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Connections
-
None
Currently connection pool code is split between the pool and the queue, which is really a stack. This split makes the pool awkward to work with, and even more so when we need to add the wait queue for CMAP spec. Having the code split also makes it more difficult to reason about thread safety and which operations should be locked.
Consolidating all code in the connection pool class will make the code more readable and less error prone.
At the same time as moving the code, another improvement that can be done is have the connection pool track checked out connections. This will improve diagnostics and accountability of the pool.