Merge "Add locks for methods which sets nat rules in router"
This commit is contained in:
commit
c9a41ddd56
@ -169,7 +169,7 @@ class PortForwardingAgentExtension(l3_extension.L3AgentExtension):
|
||||
iptables_manager.ipv4['nat'].add_chain(chain)
|
||||
iptables_manager.ipv4['nat'].add_rule(chain, rule, tag=rule_tag)
|
||||
|
||||
@coordination.synchronized('port-forwarding-{namespace}')
|
||||
@coordination.synchronized('router-lock-ns-{namespace}')
|
||||
def _process_create(self, port_forwardings, ri, interface_name, namespace,
|
||||
iptables_manager):
|
||||
if not port_forwardings:
|
||||
@ -301,7 +301,7 @@ class PortForwardingAgentExtension(l3_extension.L3AgentExtension):
|
||||
context, [port_forwarding], ri, interface_name, namespace,
|
||||
iptables_manager)
|
||||
|
||||
@coordination.synchronized('port-forwarding-{namespace}')
|
||||
@coordination.synchronized('router-lock-ns-{namespace}')
|
||||
def _process_update(self, port_forwardings, iptables_manager,
|
||||
interface_name, namespace):
|
||||
if not port_forwardings:
|
||||
@ -326,7 +326,7 @@ class PortForwardingAgentExtension(l3_extension.L3AgentExtension):
|
||||
iptables_manager.apply()
|
||||
self._store_local(port_forwardings, events.UPDATED)
|
||||
|
||||
@coordination.synchronized('port-forwarding-{namespace}')
|
||||
@coordination.synchronized('router-lock-ns-{namespace}')
|
||||
def _process_delete(self, context, port_forwardings, ri, interface_name,
|
||||
namespace, iptables_manager):
|
||||
if not port_forwardings:
|
||||
|
@ -28,6 +28,7 @@ from neutron.agent.l3 import namespaces
|
||||
from neutron.agent.linux import ip_lib
|
||||
from neutron.agent.linux import iptables_manager
|
||||
from neutron.agent.linux import ra
|
||||
from neutron.common import coordination
|
||||
from neutron.common import ipv6_utils
|
||||
from neutron.common import utils as common_utils
|
||||
from neutron.ipam import utils as ipam_utils
|
||||
@ -985,6 +986,7 @@ class RouterInfo(BaseRouterInfo):
|
||||
finally:
|
||||
self.update_fip_statuses(fip_statuses)
|
||||
|
||||
@coordination.synchronized('router-lock-ns-{self.ns_name}')
|
||||
def process_external(self):
|
||||
fip_statuses = {}
|
||||
try:
|
||||
@ -1211,6 +1213,7 @@ class RouterInfo(BaseRouterInfo):
|
||||
self.get_address_scope_mark_mask(address_scope))
|
||||
iptables_manager.ipv4['nat'].add_rule('snat', rule)
|
||||
|
||||
@coordination.synchronized('router-lock-ns-{self.ns_name}')
|
||||
def process_address_scope(self):
|
||||
with self.iptables_manager.defer_apply():
|
||||
self.process_ports_address_scope_iptables()
|
||||
|
Loading…
Reference in New Issue
Block a user