[Checkins] [zopefoundation/zope.sqlalchemy] c340e1: Use a WeakKeyDictionary to store session => status...

GitHub noreply at github.com
Sat Jan 27 11:26:11 CET 2018


  Branch: refs/heads/master
  Home:   https://github.com/zopefoundation/zope.sqlalchemy
  Commit: c340e19ef6922d7075196f9c706db73368cdf968
      https://github.com/zopefoundation/zope.sqlalchemy/commit/c340e19ef6922d7075196f9c706db73368cdf968
  Author: Robert Knight <robertknight at gmail.com>
  Date:   2018-01-11 (Thu, 11 Jan 2018)

  Changed paths:
    M src/zope/sqlalchemy/datamanager.py
    M src/zope/sqlalchemy/tests.py

  Log Message:
  -----------
  Use a WeakKeyDictionary to store session => status map

Stale entries for old sessions could be left in the `id(session) =>
status` map if an application failed to end a transaction after a
session event, from the set used by `zope.sqlalchemy.register`, caused
the session to be joined to the transaction.

While such issues often indicate an error on the part of the
application, this can lead to difficult-to-debug issues because IDs can
be re-used in the lifetime of a Python process, so a stale entry for an
old Session may affect what happens to a future, unrelated Session.

Using a weak dict of `session => state` avoids this hazard.


  Commit: 97e1326c150895a3faf30514441137e1380e884d
      https://github.com/zopefoundation/zope.sqlalchemy/commit/97e1326c150895a3faf30514441137e1380e884d
  Author: Robert Knight <robertknight at gmail.com>
  Date:   2018-01-11 (Thu, 11 Jan 2018)

  Changed paths:
    M src/zope/sqlalchemy/README.txt

  Log Message:
  -----------
  Fix doctests

Additional explanatory text has been added to the end of the exception
message in newer SQLAlchemy releases.


  Commit: a89910a6876d1886f0b5cb38d2c4ebe1ff4c55e6
      https://github.com/zopefoundation/zope.sqlalchemy/commit/a89910a6876d1886f0b5cb38d2c4ebe1ff4c55e6
  Author: Robert Knight <robertknight at gmail.com>
  Date:   2018-01-27 (Sat, 27 Jan 2018)

  Changed paths:
    M src/zope/sqlalchemy/datamanager.py
    M src/zope/sqlalchemy/tests.py

  Log Message:
  -----------
  Merge pull request #23 from hypothesis/use-weakrefs-for-session-state

Use a WeakKeyDictionary to store session => status map


Compare: https://github.com/zopefoundation/zope.sqlalchemy/compare/378ac59a0bb4...a89910a6876d


More information about the checkins mailing list