SQLAlchemy session is reused by multiple greenthreads

Bug #1343211 reported by Kiall Mac Innes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Designate
Fix Released
Critical
Kiall Mac Innes

Bug Description

The SQLAlchemy session object is reused by multiple greenthreads, this can lead to really bad things happening.

Each (green)thread needs it's own instance of the Session, otherwise multiple concurrent requests may end up interleaved in a single database transaction, or nested transaction.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to designate (master)

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

Changed in designate:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to designate (stable/icehouse)

Fix proposed to branch: stable/icehouse
Review: https://review.openstack.org/107678

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

Reviewed: https://review.openstack.org/107644
Committed: https://git.openstack.org/cgit/openstack/designate/commit/?id=750095459b4f31ade70a65fc89e7a2084e4cbb50
Submitter: Jenkins
Branch: master

commit 750095459b4f31ade70a65fc89e7a2084e4cbb50
Author: Kiall Mac Innes <email address hidden>
Date: Thu Jul 17 11:49:50 2014 +0100

    Ensure each greenthread uses it's own Session instance

    This uses a thread local store, allowing each greenthread to
    have it's own session stored correctly. Without this, each
    greenthread may end up using a single global session, which
    leads to bad things happening.

    Change-Id: I1ceb33d2bcb531d444ad05cf6cf74b6edd4e7d39
    Closes-Bug: 1343211

Changed in designate:
status: In Progress → Fix Committed
Changed in designate:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to designate (stable/icehouse)

Reviewed: https://review.openstack.org/107678
Committed: https://git.openstack.org/cgit/openstack/designate/commit/?id=b3ec3342b595e8486b08ea7dcf99dd45edf24ebe
Submitter: Jenkins
Branch: stable/icehouse

commit b3ec3342b595e8486b08ea7dcf99dd45edf24ebe
Author: Kiall Mac Innes <email address hidden>
Date: Thu Jul 17 11:49:50 2014 +0100

    Ensure each greenthread uses it's own Session instance

    This uses a thread local store, allowing each greenthread to
    have it's own session stored correctly. Without this, each
    greenthread may end up using a single global session, which
    leads to bad things happening.

    Conflicts:
            designate/storage/impl_sqlalchemy/__init__.py

    Change-Id: I1ceb33d2bcb531d444ad05cf6cf74b6edd4e7d39
    Closes-Bug: 1343211

tags: added: in-stable-icehouse
Thierry Carrez (ttx)
Changed in designate:
milestone: juno-2 → 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.