The current code looks like below.
In the function getOpenTxns, it will request another connection from pool. That is, this thread already held a connection, however, it would request for another connection. When there are more than 10 (default connection pool size) simultaneous getValidWriteIds requests, it can cause a starvation problem. In that situation, each thread holds a connection and waits for another connection. Then, we will see the following exception after timeout.