]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Create explicit GC ordering between ConnectionFairy/ConnectionRecord
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 14 Jan 2021 23:07:14 +0000 (18:07 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 15 Jan 2021 05:29:12 +0000 (00:29 -0500)
commit44034f19ac27ccd4a0e57dfa3d2d6b494dc9b133
tree9837f4818d8e345fc36fe99cd888825832a6b98e
parent41ca37734aa4f293ac5fb63c239d78185c8ec983
Create explicit GC ordering between ConnectionFairy/ConnectionRecord

Fixed issue where connection pool would not return connections to the pool
or otherwise be finalized upon garbage collection under pypy if the checked
out connection fell out of scope without being closed.   This is a long
standing issue due to pypy's difference in GC behavior that does not call
weakref finalizers if they are relative to another object that is also
being garbage collected.  A strong reference to the related record is now
maintained so that the weakref has a strong-referenced "base" to trigger
off of.

Fixes: #5842
Change-Id: Id5448fdacb6cceaac1ea40b2fbc851f052ed8e86
doc/build/changelog/unreleased_14/pypy_gc_pool.rst [new file with mode: 0644]
doc/build/core/operators.rst
doc/build/core/tutorial.rst
doc/build/orm/queryguide.rst
doc/build/orm/tutorial.rst
lib/sqlalchemy/pool/base.py
lib/sqlalchemy/testing/assertions.py
lib/sqlalchemy/testing/engines.py
lib/sqlalchemy/testing/plugin/plugin_base.py
test/engine/test_pool.py
test/engine/test_reconnect.py