Comment 2 for bug 1722404

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

Reviewed: https://review.openstack.org/510691
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=3cc3cc453dc16e22365bea597c1be5bb0be57aeb
Submitter: Jenkins
Branch: master

commit 3cc3cc453dc16e22365bea597c1be5bb0be57aeb
Author: melanie witt <email address hidden>
Date: Mon Oct 9 20:36:59 2017 +0000

    Fix target_cell usage for scatter_gather_cells

    In the set_target_cell method, we synchronize access to the cached cell
    database transaction context manager objects to prevent more than one
    thread from using a cell's transaction context manager at the same
    time.

    In scatter_gather_cells, we're calling target_cell in such a way that
    the lock is acquired and released BEFORE the green thread actually
    accesses the database in the spawned function. So multiple threads can
    access a cell's database transaction context manager and it's possible
    for a database transaction to fail with the error:

      TypeError: Can't upgrade a READER transaction to a WRITER
                 mid-transaction

    because the in-scope transaction context might be in the middle of a
    read when a concurrent green thread tries to do a write.

    Closes-Bug: #1722404

    Change-Id: I07dd4d5aebdc82e343ec2035dc94c744e4754c96