Increase HTTP Request Timeout for Software Upload

The software upload command fails due to a timeout while waiting for
the HTTP response.
This issue arises specifically when uploading larger patches,
such as a 1GB file, for example:
software upload test.patch

To address this, increasing the timeout to the existing
UPLOAD_REQUEST_TIMEOUT (30 minutes) resolved the problem.
In a VBOX AIO-SX environment, the system required almost 10 minutes
to complete the upload and 7 minutes 30 seconds to delete the patch.

As a potential improvement, implementing the upload as an
asynchronous command could further enhance performance,
especially for large file uploads.

Test Done:

Tested software upload on AIO-SX with a 1GB patch file

Story: 2010676
Task: 51253
Change-Id: I46018bb6b139a0d067a74df2c39e33e0fc4dc347
Signed-off-by: Fabiano Correa Mercer <fabiano.correamercer@windriver.com>
This commit is contained in:
Fabiano Correa Mercer 2024-11-04 16:51:34 -03:00
parent c4f8751daa
commit a0e50c0e25

View File

@ -213,7 +213,7 @@ class SessionClient(adapter.LegacyJsonAdapter):
if 'body' in kwargs:
kwargs['data'] = jsonutils.dumps(kwargs.pop('body'))
resp = self._http_request(url, method, **kwargs)
resp = self._http_request(url, method, timeout=UPLOAD_REQUEST_TIMEOUT, **kwargs)
body = resp.content
content_type = resp.headers.get('content-type', None)
status = resp.status_code
@ -235,7 +235,7 @@ class SessionClient(adapter.LegacyJsonAdapter):
if 'body' in kwargs:
kwargs['data'] = kwargs.pop('body')
resp = self._http_request(url, method, **kwargs)
resp = self._http_request(url, method, timeout=UPLOAD_REQUEST_TIMEOUT, **kwargs)
body = resp.content
content_type = resp.headers.get('content-type', None)
status = resp.status_code