Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leaks with UnitOfWork instances #131

Closed
quantus opened this issue Mar 18, 2016 · 3 comments
Closed

Memory leaks with UnitOfWork instances #131

quantus opened this issue Mar 18, 2016 · 3 comments

Comments

@quantus
Copy link
Contributor

quantus commented Mar 18, 2016

Continuum can leak UnitOfWork instances stored in the VersioningManager. First of all the items are not removed from the dictionary in function VersioningManager.clear. This is simple to fix by adding line del self.units_of_work[conn].

Other issue is that when using continuum with flask-sqlalchemy the function VersioningManager.clear gets called with SignallingSession after the transaction commit phase is completed. VersioningManager uses connections as keys to find the active UnitOfWork instance from unit_of_works dictionary and when SignallingSession's bind value is an Engine instead of Connection the manager fails to find the right unit of work instance. Thus the unit of work instance never gets removed from the dictionary even when the del statement is added as above.

The second issue doesn't happen when the Session is created with a Connection as a bind value, but this isn't possible when using flask-sqlalchemy.

quantus added a commit to quantus/sqlalchemy-continuum that referenced this issue Mar 18, 2016
quantus added a commit to quantus/sqlalchemy-continuum that referenced this issue Mar 18, 2016
quantus added a commit to quantus/sqlalchemy-continuum that referenced this issue Mar 18, 2016
@fake-name
Copy link

fake-name commented Jan 26, 2017

For the love of god, PLEASE release a new version on PyPi. I've been fighting this issue for months, assuming it was fixed.

Goddammit.

@kvesteri
Copy link
Owner

Done and sorry for keeping you waiting.

@fake-name
Copy link

fake-name commented Jan 31, 2017

Awesome. I can remove the git dependency in my build process.

Thanks a bunch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants