Comment 4 for bug 1962153

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron-lib (master)

Reviewed: https://review.opendev.org/c/openstack/neutron-lib/+/828738
Committed: https://opendev.org/openstack/neutron-lib/commit/ef1e8abb89141db39e62eaa1cbdb73aca1ceb647
Submitter: "Zuul (22348)"
Branch: master

commit ef1e8abb89141db39e62eaa1cbdb73aca1ceb647
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Sun Feb 6 09:54:23 2022 +0000

    Refactor session "is_active" handling for sqlalchemy-20

    Since sqlalchemy 1.4, "session.autocommit" is False by default; in
    sqlalchemy 2.0 this will be the only value accepted.

    The ``_orm.Session`` is considered active when [1]:
    - there is a transaction and this transaction is active
    - there is no transaction [2], the class ``_orm.Session`` will
      autobegin when it is first used.

    The second one breaks the way Neutron considers a session is active:
    only when a transaction is in place, Neutron considers a session is
    active.

    Depends-On: https://review.opendev.org/c/openstack/neutron/+/833247

    [1]https://github.com/sqlalchemy/sqlalchemy/blob/rel_1_4/lib/sqlalchemy/orm/session.py#L3918-L3950
    [2]https://github.com/sqlalchemy/sqlalchemy/blob/rel_1_4/lib/sqlalchemy/orm/session.py#L3930-L3932

    Closes-Bug: #1962153
    Topic: sqlalchemy-20

    Change-Id: Iabaee4e556afb3dc75a82d99dc4a597fe4d7dd21