From d578ac729c62f370eaf563d8619d4c3f5f071887 Mon Sep 17 00:00:00 2001 From: Elena Ezhova Date: Wed, 30 Sep 2015 12:36:32 +0300 Subject: [PATCH] Consume FWaaS plugin queue in RPC workers This patch adds all RPC workers to consumers of FWaaS plugin queue. This is important for DVR-enabled deployments with hundreds of agents. Change-Id: I656ef6248379c845c4c7862fabd26eedd8b7fd46 Depends-On: I6fea7f409c91b25d2c35b038d6100fdfa85d1905 Related-Bug: #1498844 (cherry picked from commit bda2c484cb25d3a02d9beceab83873bd60569e46) --- neutron_fwaas/services/firewall/fwaas_plugin.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/neutron_fwaas/services/firewall/fwaas_plugin.py b/neutron_fwaas/services/firewall/fwaas_plugin.py index 4f06b07bf..8e2614e9e 100644 --- a/neutron_fwaas/services/firewall/fwaas_plugin.py +++ b/neutron_fwaas/services/firewall/fwaas_plugin.py @@ -145,12 +145,7 @@ class FirewallPlugin( def __init__(self): """Do the initialization for the firewall service plugin here.""" - self.endpoints = [FirewallCallbacks(self)] - - self.conn = n_rpc.create_connection(new=True) - self.conn.create_consumer( - topics.FIREWALL_PLUGIN, self.endpoints, fanout=False) - self.conn.consume_in_threads() + self.start_rpc_listeners() self.agent_rpc = FirewallAgentApi( topics.L3_AGENT, @@ -158,6 +153,14 @@ class FirewallPlugin( ) firewall_db.subscribe() + def start_rpc_listeners(self): + self.endpoints = [FirewallCallbacks(self)] + + self.conn = n_rpc.create_connection(new=True) + self.conn.create_consumer( + topics.FIREWALL_PLUGIN, self.endpoints, fanout=False) + return self.conn.consume_in_threads() + def _rpc_update_firewall(self, context, firewall_id): status_update = {"firewall": {"status": const.PENDING_UPDATE}} super(FirewallPlugin, self).update_firewall(context, firewall_id,