Test auto-purging of the available-connection deque.
This triggered some code changes. When closing a connection, the meaning of "the pool is too big" is debatable: it may mean that the number of all connections the pool knows about exceeds pool_size, or it may mean that the stack of available connections (a subset of all the connections) exceeds pool_size. The code was changed to mean the latter, primarily because it's predictable. The total number of connections the pool knows about can change at any time, because it depends on which weak references DB holds that cyclic gc hasn't yet cleared. But it doesn't matter much either way, since clients are never "supposed to" exceed pool_size anyway. I think it degrades more gracefully this way.
Showing
Please register or sign in to comment