Increase RPC client timeout for subcloud backup delete

The scalability test for subcloud backup delete
failed with RPC client timeout. This commit increases
the rpc client timeout for backup delete to 2 minutes.

Test Plan:
PASS - Scalability tests
1. Add a large number of subclouds (250 or more)
2. Execute dcmanager subcloud-backup create
- Batch 250
- systemcontroller and local
3. Execute dcmanager subcloud-backup delete
- Batch 250
- systemcontroller and local
PASS - Subcloud Deployment & Manage tests (regression tests)


Story: 2010116
Task: 46856

Signed-off-by: Hugo Brito <hugo.brito@windriver.com>
Change-Id: Ibbd3151ef94d07fbea9a0664c1c96570fc72a5eb
This commit is contained in:
Hugo Brito
2022-11-15 16:04:34 -03:00
committed by Hugo Nicodemos
parent 3c6cac4960
commit 072b7e2aab
6 changed files with 26 additions and 18 deletions

View File

@@ -39,7 +39,8 @@ RequestEntity = namedtuple('RequestEntity', ['type', 'id', 'name', 'subclouds'])
class SubcloudBackupController(object):
def __init__(self):
super(SubcloudBackupController, self).__init__()
self.dcmanager_rpc_client = rpc_client.ManagerClient()
self.dcmanager_rpc_client = rpc_client.ManagerClient(
timeout=consts.RPC_SUBCLOUD_BACKUP_TIMEOUT)
@expose(generic=True, template='json')
def index(self):

View File

@@ -29,8 +29,9 @@ class ManagerAuditClient(object):
BASE_RPC_API_VERSION = '1.0'
def __init__(self):
def __init__(self, timeout=None):
self._client = messaging.get_rpc_client(
timeout=timeout,
topic=consts.TOPIC_DC_MANAGER_AUDIT,
version=self.BASE_RPC_API_VERSION)
@@ -90,8 +91,9 @@ class ManagerAuditWorkerClient(object):
# todo(abailey): Does the RPC version need to increment
BASE_RPC_API_VERSION = '1.0'
def __init__(self):
def __init__(self, timeout=None):
self._client = messaging.get_rpc_client(
timeout=timeout,
topic=consts.TOPIC_DC_MANAGER_AUDIT_WORKER,
version=self.BASE_RPC_API_VERSION)

View File

@@ -14,6 +14,7 @@
#
RPC_API_VERSION = "1.0"
RPC_SUBCLOUD_BACKUP_TIMEOUT = 120
TOPIC_DC_MANAGER = "dcmanager"
TOPIC_DC_MANAGER_STATE = "dcmanager-state"

View File

@@ -94,11 +94,12 @@ def get_rpc_server(target, endpoint):
serializer=serializer)
def get_rpc_client(**kwargs):
def get_rpc_client(timeout, **msg_target_kwargs):
"""Return a configured oslo_messaging RPCClient."""
target = oslo_messaging.Target(**kwargs)
target = oslo_messaging.Target(**msg_target_kwargs)
serializer = RequestContextSerializer(JsonPayloadSerializer())
return oslo_messaging.RPCClient(TRANSPORT, target,
# With timeout == None the default value will be 60 seconds
return oslo_messaging.RPCClient(TRANSPORT, target, timeout=timeout,
serializer=serializer)

View File

@@ -29,8 +29,9 @@ class ManagerOrchestratorClient(object):
BASE_RPC_API_VERSION = '1.0'
def __init__(self):
def __init__(self, timeout=None):
self._client = messaging.get_rpc_client(
timeout=timeout,
topic=consts.TOPIC_DC_MANAGER_ORCHESTRATOR,
version=self.BASE_RPC_API_VERSION)

View File

@@ -31,10 +31,9 @@ class RPCClient(object):
Basic RPC client implementation to deliver RPC 'call' and 'cast'
"""
def __init__(self, topic, version):
self._client = messaging.get_rpc_client(
topic=topic,
version=version)
def __init__(self, timeout, topic, version):
self._client = messaging.get_rpc_client(timeout=timeout, topic=topic,
version=version)
@staticmethod
def make_msg(method, **kwargs):
@@ -62,8 +61,9 @@ class SubcloudStateClient(RPCClient):
BASE_RPC_API_VERSION = '1.0'
def __init__(self):
def __init__(self, timeout=None):
super(SubcloudStateClient, self).__init__(
timeout,
consts.TOPIC_DC_MANAGER_STATE,
self.BASE_RPC_API_VERSION)
@@ -114,8 +114,9 @@ class ManagerClient(RPCClient):
BASE_RPC_API_VERSION = '1.0'
def __init__(self):
def __init__(self, timeout=None):
super(ManagerClient, self).__init__(
timeout,
consts.TOPIC_DC_MANAGER,
self.BASE_RPC_API_VERSION)
@@ -184,13 +185,14 @@ class DCManagerNotifications(RPCClient):
Version History:
1.0 - Initial version
"""
DCMANAGER_RPC_API_VERSION = '1.0'
TOPIC_DC_NOTIFICIATION = 'DCMANAGER-NOTIFICATION'
def __init__(self):
DCMANAGER_RPC_API_VERSION = '1.0'
TOPIC_DC_NOTIFICIATION = 'DCMANAGER-NOTIFICATION'
def __init__(self, timeout=None):
super(DCManagerNotifications, self).__init__(
TOPIC_DC_NOTIFICIATION, DCMANAGER_RPC_API_VERSION)
timeout,
self.TOPIC_DC_NOTIFICIATION,
self.DCMANAGER_RPC_API_VERSION)
def subcloud_online(self, ctxt, subcloud_name):
return self.cast(ctxt, self.make_msg('subcloud_online',