- changed status to duplicate
_overflow miscalculation can cause hangs
Issue #223
resolved
QueuePool do_return_invalid needs to always decrement overflow, or eventually (assuming max_overflow >= 0) you'll try to do a blocking get on an empty Queue, and hang.
You can reproduce this with a DBProxy having a small pool_size, max_overflow=0, and just get a connection + invalidate it until you hang.
It's more clear that "always decrement on invalidation" is the correct policy when you consider that pool_size + _overflow represents the number of created connections that will go back into the queue when released; an invalidated connection should thus always result in _overflow -= 1.
Comments (1)
-
repo owner - Log in to comment
lets head over to
#224.invalidate()
was never really completed/tested so its no surprise it doesnt work.