]> 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:49:41 +0000 (11:49 -0400)
commit676c49b51de27bf061bb8d7cfae59fd850e28a36
tree2fb7f89fd18fa757e94eecf05600a221f6406b89
parent3e794a199d0a9be955d079a17acd11ceaa9317cc
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
(cherry picked from commit 1a75f676d75b5daf67455d6e85b7b4df6f2316dc)
doc/build/changelog/unreleased_11/4030.rst [new file with mode: 0644]
lib/sqlalchemy/orm/identity.py