Rename confusing query timeout options

These do not actually define timeout but interval. Rename the options
to reflect what they actually define. The existing deprecated options
in the [gnocchi_client] are also removed, because these have been kept
for 6 years.

In addition, fix inconsistent name (query vs call).

Change-Id: Ib29115746a25b45bdff1c3da8df9d7167c2db662
Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
This commit is contained in:
Takashi Kajinami
2025-08-26 09:45:43 +09:00
parent 4d8f86b432
commit 7106a12251
6 changed files with 44 additions and 19 deletions

View File

@@ -78,7 +78,7 @@ class DataSourceBase(object):
"""
num_retries = CONF.watcher_datasources.query_max_retries
timeout = CONF.watcher_datasources.query_timeout
interval = CONF.watcher_datasources.query_interval
ignored_exc = ignored_exc or tuple()
for i in range(num_retries):
@@ -92,8 +92,8 @@ class DataSourceBase(object):
LOG.exception(e)
self.query_retry_reset(e)
LOG.warning("Retry %d of %d while retrieving metrics retry "
"in %d seconds", i+1, num_retries, timeout)
time.sleep(timeout)
"in %d seconds", i+1, num_retries, interval)
time.sleep(interval)
@abc.abstractmethod
def query_retry_reset(self, exception_instance):

View File

@@ -201,15 +201,15 @@ class BaseModelBuilder(object):
Attempts to access data from the external service and handles
exceptions. The retrieval should be retried in accordance
to the value of api_call_retries
to the value of api_query_max_retries
:param f: The method that performs the actual querying for metrics
:param args: Array of arguments supplied to the method
:param kwargs: The amount of arguments supplied to the method
:return: The value as retrieved from the external service
"""
num_retries = CONF.collector.api_call_retries
timeout = CONF.collector.api_query_timeout
num_retries = CONF.collector.api_query_max_retries
interval = CONF.collector.api_query_interval
for i in range(num_retries):
try:
@@ -219,8 +219,8 @@ class BaseModelBuilder(object):
self.call_retry_reset(e)
LOG.warning("Retry %d of %d, error while calling service "
"retry in %s seconds",
i+1, num_retries, timeout)
time.sleep(timeout)
i+1, num_retries, interval)
time.sleep(interval)
raise
@abc.abstractmethod