From: Salvatore Orlando Date: Tue, 19 Nov 2013 17:32:35 +0000 (-0800) Subject: Enable polling minimization X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=70096ae4e74ec96ac18b236b547510422a3be70a;p=openstack-build%2Fneutron-build.git Enable polling minimization In some cases the OVS agent might end up wiring a port for a VM several seconds after the VM has booted. As a result, there is a risk that the VM won't receive an IP address from DHCP in time. This patch changes the default value for agent.minimize_polling to True. This change should reduce the time needed for configuring an interface on br-int consistently. Change-Id: I009f606fd34a132376f1d50f8ccda9d35d064bfa Related-bug: 1224001 --- diff --git a/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini b/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini index 2632a25aa..ba5791dc1 100644 --- a/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini +++ b/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini @@ -88,7 +88,7 @@ # polling_interval = 2 # Minimize polling by monitoring ovsdb for interface changes -# minimize_polling = False +# minimize_polling = True # When minimize_polling = True, the number of seconds to wait before # respawning the ovsdb monitor after losing communication with it diff --git a/neutron/plugins/openvswitch/common/config.py b/neutron/plugins/openvswitch/common/config.py index 4b473943b..038b34731 100644 --- a/neutron/plugins/openvswitch/common/config.py +++ b/neutron/plugins/openvswitch/common/config.py @@ -63,7 +63,7 @@ agent_opts = [ help=_("The number of seconds the agent will wait between " "polling for local device changes.")), cfg.BoolOpt('minimize_polling', - default=False, + default=True, help=_("Minimize polling by monitoring ovsdb for interface " "changes.")), cfg.IntOpt('ovsdb_monitor_respawn_interval', diff --git a/neutron/tests/unit/openvswitch/test_ovs_neutron_agent.py b/neutron/tests/unit/openvswitch/test_ovs_neutron_agent.py index 1ffa79e01..d2ac269fe 100644 --- a/neutron/tests/unit/openvswitch/test_ovs_neutron_agent.py +++ b/neutron/tests/unit/openvswitch/test_ovs_neutron_agent.py @@ -588,7 +588,7 @@ class TestOvsNeutronAgent(base.BaseTestCase): 'neutron.agent.linux.polling.get_polling_manager') as mock_get_pm: with mock.patch.object(self.agent, 'rpc_loop') as mock_loop: self.agent.daemon_loop() - mock_get_pm.assert_called_with(False, 'sudo', + mock_get_pm.assert_called_with(True, 'sudo', constants.DEFAULT_OVSDBMON_RESPAWN) mock_loop.called_once()