File: add-retry-of-get_bgp_speakers.patch

package info (click to toggle)
neutron-dynamic-routing 2%3A21.0.0-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,172 kB
  • sloc: python: 6,397; sh: 152; makefile: 41
file content (30 lines) | stat: -rw-r--r-- 1,191 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Description: Retry get_bgp_speakers() until it works
 This mitigates the RPC call failing 7 times out of 8 when calling the RPC
 method get_bgp_speakers().
Author: Thomas Goirand <zigo@debian.org>
Forwarded: no
Last-Update: 2020-08-05

--- neutron-dynamic-routing-16.0.0.orig/neutron_dynamic_routing/services/bgp/agent/bgp_dragent.py
+++ neutron-dynamic-routing-16.0.0/neutron_dynamic_routing/services/bgp/agent/bgp_dragent.py
@@ -14,6 +14,7 @@
 # limitations under the License.
 
 import collections
+from tenacity import *
 
 from neutron_lib.agent import constants as agent_consts
 from neutron_lib.agent import topics
@@ -544,9 +545,11 @@ class BgpDrPluginApi(object):
         target = oslo_messaging.Target(topic=topic, version='1.0')
         self.client = n_rpc.get_client(target)
 
+    @retry
     def get_bgp_speakers(self, context):
         """Make a remote process call to retrieve all BGP speakers info."""
-        cctxt = self.client.prepare()
+        LOG.debug('RPC: get_bgp_speakers()')
+        cctxt = self.client.prepare(timeout=2)
         return cctxt.call(context, 'get_bgp_speakers', host=self.host)
 
     def get_bgp_speaker_info(self, context, bgp_speaker_id):