From 1ca8c3a94d70013bb82654d0ad15d56df9260f71 Mon Sep 17 00:00:00 2001 From: junfeng-li Date: Thu, 4 Dec 2025 19:38:34 +0000 Subject: [PATCH] Revert "Add retry in requests for software" This reverts commit 9fee46d0b835f7ae2732688ec7836461932a4384. This revert is to handle the duplicated requests that may come from retry mechanism. Test Plan: PASS: build and deploy the iso PASS: run software commands Task: 53151 Story: 2011604 Change-Id: Icbeb6095af2ca326888419f45cec2c1eae5018af Signed-off-by: junfeng-li --- software-client/software_client/common/http.py | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/software-client/software_client/common/http.py b/software-client/software_client/common/http.py index 85ace055..ff3866ce 100644 --- a/software-client/software_client/common/http.py +++ b/software-client/software_client/common/http.py @@ -17,14 +17,11 @@ import copy import httplib2 -from http.client import RemoteDisconnected from keystoneauth1 import adapter -from keystoneauth1.exceptions.connection import ConnectFailure import logging import os from oslo_serialization import jsonutils import socket -import time import six @@ -45,7 +42,6 @@ UPLOAD_REQUEST_TIMEOUT = 1800 USER_AGENT = 'software_client' API_VERSION = '/v1' DEFAULT_API_VERSION = 'latest' -MAX_RETRIES = 3 # httplib2 retries requests on socket.timeout which # is not idempotent and can lead to orhan objects. @@ -193,16 +189,8 @@ class SessionClient(adapter.LegacyJsonAdapter): endpoint_filter.setdefault('service_type', self.service_type) endpoint_filter.setdefault('region_name', self.region_name) - for attempt in range(1, MAX_RETRIES + 1): - try: - resp = self.session.request(url, method, - raise_exc=False, **kwargs) - except (RemoteDisconnected, ConnectFailure) as e: - _logger.warning(f"Attempt {attempt}/{MAX_RETRIES} failed: %s", e) - if attempt == MAX_RETRIES: - raise - time.sleep(2 * attempt) - + resp = self.session.request(url, method, + raise_exc=False, **kwargs) # NOTE (bqian) Do not recreate and raise exceptions. Let the # display_error utility function to handle the well formatted # response for webob.exc.HTTPClientError