platinummonkey / rexpro-python

Python RexPro Interface
Other
5 stars 7 forks source link

Fix: always return connections back to the pool #11

Closed nvie closed 10 years ago

nvie commented 10 years ago

This caught us badly in a long-running process where a bunch of failures accumulated, which led to the connection pool filling up. The processes using the connection had ended, and new processes could not acquire any of the connections, effectively deadlocking the system.

This patch makes sure that connections are always put back into the pool at the end of the context manager's body, even in case of failure.

nvie commented 10 years ago

Thanks for the quick merge! Mind to release this as a new version to PyPI?

platinummonkey commented 10 years ago

Not a problem! I am doing that now!

platinummonkey commented 10 years ago

v0.3.3 is now on PyPI

nvie commented 10 years ago

awesome, thanks!