_ConnectionPool._reduce_size provides no hook
Bug #143927 reported by
John Eikenberry
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ZODB |
Triaged
|
Wishlist
|
Unassigned |
Bug Description
Tracked down a local memory leak to Zope leaking database connections when the _ConnectionPool is temporarily expanded beyond the target size. When the pool is resized the mysql connections are leaked. This is a known limitation with mysqldb, that you must explicitally close() a connection or it will leak. But there is no hook provided to do this.
Unless I'm missing some way of doing this (always possible) I think providing a hook here would really help when dealing with not quite well behaved C modules.
affects: | zope2 → zodb |
Changed in zodb: | |
importance: | Medium → Wishlist |
status: | New → Triaged |
To post a comment you must log in.
After thinking about this some more I don't think a callback/hook would work here as there are no guarantees that the connection is not still in use at this point.
Maybe I could check for this in a synchronizer. Detect that the connection has been removed from the pool and close the database connection. Detecting that the connection has been removed from the pool is the trick though.