]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Guard all indexed access in WeakInstanceDict
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 17 Jul 2017 15:06:22 +0000 (11:06 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 24 Jul 2017 15:48:13 +0000 (11:48 -0400)
commit3d8049e32d63920f053f10328cc7152a16385ec2
treeff46fe49c8dc36a402be41cc28046df8319055fb
parent8d4a4049f4b210637ff403aa77f871788ba94b28
Guard all indexed access in WeakInstanceDict

Added ``KeyError`` checks to all methods within
:class:`.WeakInstanceDict` where a check for ``key in dict`` is
followed by indexed access to that key, to guard against a race against
garbage collection that under load can remove the key from the dict
after the code assumes its present, leading to very infrequent
``KeyError`` raises.

Change-Id: I881cc2899f7961d29a0549f44149a2615ae7a4ea
Fixes: #4030
doc/build/changelog/unreleased_11/4030.rst [new file with mode: 0644]
lib/sqlalchemy/orm/identity.py