Comment 9 for bug 1532696

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

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

commit fb375bd7a40f6ff86ac1db2134466d0183690f7e
Author: Anh Tran <email address hidden>
Date: Fri Jul 22 17:59:03 2016 +0700

    Prevent duplicate SG rules in 'concurrent requests' case

    Problem: The process of transaction is too short.
    In case of concurrent requests, both requests can pass all tests
    and going to write to database. Sometimes the transaction of first
    request closed before the transaction of the second request has been
    open, because of the above problem. So both of them can access the
    latest data (revision number), then passing the StaleDataError and
    writing to database successfully.

    This patch moved the _check_for_duplicate_rules_in_db into transaction
    to prevent race condition.

    Change-Id: I9ff2bf830c0c9d1114833d33603622f447ee7ca2
    Closes-bug: #1532696