SQLAlchemy transaction lingering across requests

Bug #1376239 reported by John Wood
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Barbican
Fix Released
Critical
John Wood

Bug Description

The SQLAlchemy transaction used in the thread-local session is persisting objects beyond individual requests, leading to inconsistent processing such as the 2-step secret's encrypted data not being retrieved sometimes when a subsequent GET is performed on that secret, resulting in a 404 error.

The SQLAlchemy session/transaction needs to be ended after each request. Pecan provides a means to do this for requests as per this page: http://pecan.readthedocs.org/en/latest/databases.html. The worker processes will need to ensure the session is ended once each RPC task is completed.

John Wood (john-wood-w)
Changed in barbican:
assignee: nobody → John Wood (john-wood-w)
Changed in barbican:
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to barbican (master)

Fix proposed to branch: master
Review: https://review.openstack.org/125468

Changed in barbican:
status: Confirmed → In Progress
Changed in barbican:
importance: Undecided → Critical
milestone: none → juno-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to barbican (master)

Reviewed: https://review.openstack.org/125468
Committed: https://git.openstack.org/cgit/openstack/barbican/commit/?id=7dcef77005664b2958fd4e0a4514b5f2d23111d2
Submitter: Jenkins
Branch: master

commit 7dcef77005664b2958fd4e0a4514b5f2d23111d2
Author: jfwood <email address hidden>
Date: Wed Oct 1 13:54:16 2014 -0500

    Sync SQLAlchemy lifecycle to request cycle

    SQLAlchemy session/transaction lifecycles should be synchronized to
    request lifecycles, initiating with session binding to the database
    engine, followed by data model processing, followed by either a
    commit() or rollback(), and finally a session disposal once the request
    is completed. This CR creates repository module functions for each of
    these lifecycle operations. For the API process, this means utilizing
    Pecan's transaction hook to invoke the SQLAlchemy lifecycle functions
    above. For the Worker process, this means decorating each RPC method
    invoked from queue to call the above lifecycle functions.

    Change-Id: Id7216eb6871dae849f782a0f196210cd85d08f2f
    Closes-Bug: #1376239

Changed in barbican:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in barbican:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in barbican:
milestone: juno-rc1 → 2014.2
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.