]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Increase ovsdb_monitor.SimpleInterfaceMonitor start timeout
authorMiguel Angel Ajo <mangelajo@redhat.com>
Mon, 18 Aug 2014 10:32:26 +0000 (12:32 +0200)
committerMiguel Angel Ajo <mangelajo@redhat.com>
Mon, 25 Aug 2014 18:58:24 +0000 (20:58 +0200)
The current timeout fails during functional testing with
slightly higher load. Increasing it will lower the timeout
chances during high load conditions. Changed from 5 seconds
to respawn_interval/2. DEFAULT_OVSDBMON_RESPAWN = 30 , so
the default timeout will be 15 seconds.

Change-Id: I6a9e2977b275e96dcf01c4df90a33169c42287d6
Closes-Bug: #1358206

neutron/agent/linux/ovsdb_monitor.py

index 4dcdc57e97f2ef5831bccf62682b03c139c7210b..c49bdc5f1910f0bc1f136441ec1b52b9979edabb 100644 (file)
@@ -69,6 +69,10 @@ class SimpleInterfaceMonitor(OvsdbMonitor):
             respawn_interval=respawn_interval,
         )
         self.data_received = False
+        if respawn_interval:
+            self._default_timeout = respawn_interval / 2
+        else:
+            self._default_timeout = 10
 
     @property
     def is_active(self):
@@ -87,7 +91,8 @@ class SimpleInterfaceMonitor(OvsdbMonitor):
         """
         return bool(list(self.iter_stdout())) or not self.is_active
 
-    def start(self, block=False, timeout=5):
+    def start(self, block=False, timeout=None):
+        timeout = timeout or self._default_timeout
         super(SimpleInterfaceMonitor, self).start()
         if block:
             eventlet.timeout.Timeout(timeout)