Comment 5 for bug 1827882

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

Reviewed: https://review.opendev.org/657645
Committed: https://git.openstack.org/cgit/starlingx/config/commit/?id=8e0278f52532aa019ac76ebc4503d4359e11c7a4
Submitter: Zuul
Branch: master

commit 8e0278f52532aa019ac76ebc4503d4359e11c7a4
Author: Allain Legacy <email address hidden>
Date: Tue May 7 07:39:30 2019 -0500

    add joined query to the interface network associations

    There is currently no explicit eager join between the interface resource
    and the interface-network resource in the data model. The API uses the
    DB data outside of the scope of the active DB session therefore if it
    attempts to reach across a foreign key relationship, and if the DB
    session has expired (or has been re-used), then the access results in an
    exception which results in an empty network list for an interface.

    Having incorrect data in the network list can lead subsequent API code
    to take an unexpected path and cause the original user request to fail.
    Since we know that whenever an interface is queried that we will be
    querying the related interface-network resources then it is better to
    add an explicit load operation on the model backref so that the DB
    session does not need to be accessed a second time outside of its valid
    scope.

    Change-Id: I56d880659ec2412b391d5bb8700a74fa7f288cbb
    Closes-Bug: 1827882
    Signed-off-by: Allain Legacy <email address hidden>