Increased API timeout for software deploy host

During periods of network or CPU congestion, software deploy host can
take longer than expected.  To mitigate this, the API timeout used by
sw-deploy-strategy has been increased.

This is not an attempt to fix the cause of the slowness, but a means to
allow VIM to operate normally under adverse conditions.

TEST PLAN:
PASS: AIO-DX sw-deploy-strategy minor patch upgrade
* No impact
PASS: AIO-DX sw-deploy-strategy minor patch upgrade
* Modify patch to take a long time
* Confirm new timeout was used

Closes-Bug: 2089793
Signed-off-by: Joshua Kraitberg <joshua.kraitberg@windriver.com>
Change-Id: I9caafd2d70e43b0795536108c2de60f8b76bdf78
This commit is contained in:
Joshua Kraitberg 2024-11-27 15:43:36 -05:00
parent cbbf25d6aa
commit 900d1ca7c6

View File

@ -14,6 +14,7 @@ from nfv_vim import nfvi
import software.states as usm_states
REST_API_REQUEST_TIMEOUT = 60
REST_API_DEPLOY_HOST_TIMEOUT = 180
DLOG = debug.debug_get_logger('nfv_plugins.nfvi_plugins.openstack.usm')
@ -58,7 +59,7 @@ def _api_post(token, url, payload, headers=None, timeout_in_secs=REST_API_REQUES
url,
headers,
json.dumps(payload),
timeout_in_secs)
timeout_in_secs=timeout_in_secs)
return response
@ -138,7 +139,7 @@ def sw_deploy_execute(token, host_name):
uri = f"deploy_host/{host_name}"
url = _usm_api_cmd(token, uri)
response = _api_post(token, url, {})
response = _api_post(token, url, {}, timeout_in_secs=REST_API_DEPLOY_HOST_TIMEOUT)
return response