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):
|