- milestone: --> Development Queue
Queuing in the Pooler. At the moment, if there are no connections available in the pooler due to the max size being reached, the operation simply fails. It would be better to queue up those requests and service them once a connection becomes available.
A couple of dangers: (1) if a transaction is in progress and it is obtaining additional connections, we risk holding a transaction open for a long time, increasing the likelihood of deadlocks. We could allow for open transactions to always receive a newly created connection to avoid this, going over the max, or allow it to be created locally on the coordinator. It could be decided to just queue up requests when it is the first statement a transaction. (2) We may run into a request for connections deadlock situation where one transaction has a connection to node 1 and is waiting for a connection to node 2, and another transaction has a connection to node 2 and is waiting for a connection on node 1.