Fix SecurityGroupExists error when booting instances
Make sure we properly handle the case when multiple threads check
and create the default security group, if it hasn't existed yet.
One thread will succeed and others will fail (we have a unique
constraint in db to prevent a race condition), so just handle the
exception to let instance boot proceed.
Reviewed: https:/ /review. openstack. org/128593 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=9ecc4688c1d 619a559e53471fb b95652f3e9c97f
Committed: https:/
Submitter: Jenkins
Branch: stable/icehouse
commit 9ecc4688c1d619a 559e53471fbb956 52f3e9c97f
Author: Roman Podoliaka <email address hidden>
Date: Thu Sep 18 03:58:59 2014 +0300
Fix SecurityGroupExists error when booting instances
Make sure we properly handle the case when multiple threads check
and create the default security group, if it hasn't existed yet.
One thread will succeed and others will fail (we have a unique
constraint in db to prevent a race condition), so just handle the
exception to let instance boot proceed.
Steps to reproduce:
1) install OpenStack with Rally using DevStack:
https:/ /github. com/stackforge/ rally/tree/ master/ contrib/ devstack
2) fetch the Rally task:
http:// boris-42. github. io/boot. yaml
3) run it
rally -v task start boot.yaml
Closes-Bug: #1370782
Conflicts:
nova/ tests/db/ test_db_ api.py
Change-Id: I414637a31b0b54 0fefa6c1314be6e 973e2d4a178 65d096bc934306d 9517d921f0)
(cherry picked from commit b0e48fdaf7442a6