-
Notifications
You must be signed in to change notification settings - Fork 101
Description
There is a major bug in the ping() function used by both of these pools. The function breaks out of the while True:
loop when the pool is empty or a session does not need to be pinged yet. This means it is unsuitable for use as a background thread as we suggest because the loop is likely to end the first time it is run.
Additionally, TransactionPingingPool puts used sessions into a pending sessions queue so they can have transactions started on them. However the begin_pending_transactions() function that removes them only runs once when the pool is created and once when the pool is bound to a database. The condition for the function loops is:
while not self._pending_session.empty():
which means if at any point there are no pending sessions, then any future pending sessions will not be refreshed. There is no documentation suggesting the a user needs to run this themselves which means this is another major bug.