The method "_connect_ping_listener" should rollback the transaction at the end

Bug #2008209 reported by Rodolfo Alonso
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.db
Fix Released
High
Rodolfo Alonso

Bug Description

The method "_connect_ping_listener" should rollback the transaction at the end. When the method finishes, the connection transaction should be aborted and deleted; the connection will be inactive again.

This issue has been spotted during the Neutron functional testing using SQLAlchemy main branch [1]. When the engine is started [2], the connection is tested [3] with the mentioned "_connect_ping_listener" method [4]. After this method, the connection transaction should be deleted to avoid the following error when trying to being a transaction with this connection (from [1]):
sqlalchemy.exc.InvalidRequestError: This connection has already initialized a SQLAlchemy Transaction() object via begin() or autobegin; can't call begin() here unless rollback() or commit() is called first.

[1]https://storage.bhs.cloud.ovh.net/v1/AUTH_dcaab5e32b234d56b626f72581e3644c/zuul_opendev_logs_680/874669/1/experimental/neutron-functional-with-sqlalchemy-master/680ee10/job-output.txt
[2]https://github.com/openstack/oslo.db/blob/7d619ae3eb2a64dadeaa9fbaeb1b9424b83414a6/oslo_db/sqlalchemy/provision.py#L145
[3]https://github.com/openstack/oslo.db/blob/7d619ae3eb2a64dadeaa9fbaeb1b9424b83414a6/oslo_db/sqlalchemy/engines.py#L225
[4]https://github.com/openstack/oslo.db/blob/7d619ae3eb2a64dadeaa9fbaeb1b9424b83414a6/oslo_db/sqlalchemy/engines.py#L55

Changed in oslo.db:
assignee: nobody → Rodolfo Alonso (rodolfo-alonso-hernandez)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo.db (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/oslo.db/+/874858

Changed in oslo.db:
status: New → In Progress
Changed in oslo.db:
importance: Undecided → High
Revision history for this message
Erik Olof Gunnar Andersson (eandersson) wrote :

Would love to see this fix merged sooner, rather than later as it blocks Designate for merging in sqlalchemy 2.x support.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.db (master)

Reviewed: https://review.opendev.org/c/openstack/oslo.db/+/874858
Committed: https://opendev.org/openstack/oslo.db/commit/877bcfc6a6ed16ba6885f47824df6b1f5ac60b4e
Submitter: "Zuul (22348)"
Branch: master

commit 877bcfc6a6ed16ba6885f47824df6b1f5ac60b4e
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Sat Feb 18 13:52:22 2023 +0100

    Rollback the connection after server ping method

    In the method ``engines._connect_ping_listener``, the connection should
    be rolled back after the ping execution. The rollback will revert the
    transaction and delete it.

    Closes-Bug: #2008209
    Change-Id: Iba29ded227634e02795052acfd89b572bf21f54c

Changed in oslo.db:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/oslo.db 13.0.0

This issue was fixed in the openstack/oslo.db 13.0.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.