Comment 5 for bug 1669528

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

Reviewed: https://review.openstack.org/441231
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=fc563eaabec392281be90bd2472bed4f6506cb40
Submitter: Jenkins
Branch: master

commit fc563eaabec392281be90bd2472bed4f6506cb40
Author: Kevin Benton <email address hidden>
Date: Fri Mar 3 08:51:33 2017 -0800

    deepcopy binding and binding levels avoid expiration

    Perform a deepcopy on the sqla objects passed into the PortContext
    so we get detached versions of them safe to reference forever.
    This is necessary because the PortContexts outlive the
    transaction context managers they are creating in which means an
    object can be expired and result in a query after a commit
    (e.g. in bind_port_if_needed) that will fail and result in an
    exception.

    This required a few additional explicit session.merge calls to deal
    with cases where touching the mech context was implicitly expected
    to modify the DB state on the next commit.

    Closes-Bug: #1669528
    Change-Id: Ib5ba2daa80acba53c082bade1f61a3ee44ca41fc