[Backport][bug/1393925] Race condition adding a security group rule when another is in-progress
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mirantis OpenStack |
Fix Committed
|
High
|
Alexander Ignatov |
Bug Description
This patch is to back-port fix for bug: https:/
Original description:
================
I've come across a race condition where I sometimes see a security group rule is never added to iptables, if the OVS agent is in the middle of applying another security group rule when the RPC arrives.
Here's an example scenario:
nova boot --flavor 1 --image $nova_image dev_server1
sleep 4
neutron security-
neutron security-
Wait for VM to complete booting, then check iptables:
$ sudo iptables-save | grep 111
-A neutron-
The second rule is missing, and will only get added if you either add another rule, or restart the agent.
My config is just devstack, running with the latest openstack bits as of today. OVS agent w/vxlan and DVR enabled, nothing fancy.
I've been able to track this down to the following code (i'll attach the complete log as a file due to line wraps):
OVS agent receives RPC to setup port
Port info is gathered for devices and filters for security groups are created
Iptables "apply" is called
New security group rule is added, triggering RPC message
RPC received, and agent seems to add device to list that needs refresh
Adding [u'741ff910-
Iptables "apply" is finished
rpc_loop() in OVS agent does not notice there is more work to do on next loop, so rule never gets added
At this point I'm thinking it could be that self.devices_
I will continue to investigate, but if someone has an "aha!" moment after reading this far please add a note.
A colleague here has also been able to duplicate this on his own devstack install, so it wasn't my fat-fingering that caused it.
Changed in mos: | |
status: | Triaged → In Progress |
Changed in mos: | |
status: | In Progress → Fix Committed |
RPM package neutron has been built for project openstack/neutron mira11. git.9a1eb5d. a299407
Package version == 2014.2, package release == fuel6.0.
Changeset: https:/ /review. fuel-infra. org/1160 ci/fuel- 6.0/2014. 2
project: openstack/neutron
branch: openstack-
author: Alexander Ignatov
committer: Alexander Ignatov
subject: Fix a race condition adding a security group rule
status: patchset-created
Files placed on repository: neutron- 2014.2- fuel6.0. mira11. git.9a1eb5d. a299407. noarch. rpm neutron- bigswitch- 2014.2- fuel6.0. mira11. git.9a1eb5d. a299407. noarch. rpm neutron- brocade- 2014.2- fuel6.0. mira11. git.9a1eb5d. a299407. noarch. rpm neutron- cisco-2014. 2-fuel6. 0.mira11. git.9a1eb5d. a299407. noarch. rpm neutron- hyperv- 2014.2- fuel6.0. mira11. git.9a1eb5d. a299407. noarch. rpm neutron- ibm-2014. 2-fuel6. 0.mira11. git.9a1eb5d. a299407. noarch. rpm neutron- linuxbridge- 2014.2- fuel6.0. mira11. git.9a1eb5d. a299407. noarch. rpm neutron- mellanox- 2014.2- fuel6.0. mira11. git.9a1eb5d. a299407. noarch. rpm neutron- metaplugin- 2014.2- fuel6.0. mira11. git.9a1eb5d. a299407. noarch. rpm neutron- metering- agent-2014. 2-fuel6. 0.mira11. git.9a1eb5d. a299407. noarch. rpm neutron- midonet- 2014.2- fuel6.0. mira11. git.9a1eb5d. a299407. noarch. rpm neutron- ml2-2014. 2-fuel6. 0.mira11. git.9a1eb5d. a299407. noarch. rpm neutron- nec-2014. 2-fuel6. 0.mira11. git.9a1eb5d. a299407. noarch. rpm neutron- nuage-2014. 2-fuel6. 0.mira11. git.9a1eb5d. a299407. noarch. rpm neutron- ofagent- 2014.2- fuel6.0. mira11. git.9a1eb5d. a299407. noarch. rpm neutron- oneconvergence- nvsd-2014. 2-fuel6. 0.mira11. git.9a1eb5d. a299407. noarch. rpm neutron- opencontrail- 2014.2- fuel6.0. mira11. git.9a1eb5d. a299407. noarch. rpm neutron- openvswitch- 2014.2- fuel6.0. mira11. git.9a1eb5d. a299407. noarch. rpm neutron- plumgrid- 2014.2- fuel6.0. mira11. git.9a1eb5d. a299407. noarch. rpm neutron- ryu-2014. 2-fuel6. 0.mira11. git.9a1eb5d. a299407. noarch. rpm neutron- vmware- 2014.2- fuel6.0. mira11. git.9a1eb5d. a299407. noarch. rpm neutron- vpn-agent- 2014.2- fuel6.0. mira11. git.9a1eb5d. a299407. noarch. rpm neutron- 2014.2- fuel6.0. mira11. git.9a1eb5d. a299407. noarch. rpm
openstack-
openstack-
openstack-
openstack-
openstack-
openstack-
openstack-
openstack-
openstack-
openstack-
openstack-
openstack-
openstack-
openstack-
openstack-
openstack-
openstack-
openstack-
openstack-
openstack-
openstack-
openstack-
python-
NOTE: Changeset is not merged, created temporary package repository. osci-obs. vm.mirantis. net:82/ centos- fuel-6. 0-stable- 1160/centos
RPM repository URL: http://