Merge "Bump lower version of oslo.db to one that includes jitter argument"

This commit is contained in:
Zuul 2019-02-19 09:52:46 +00:00 committed by Gerrit Code Review
commit cbf993c8df
3 changed files with 9 additions and 22 deletions

View File

@ -41,7 +41,7 @@ os-traits==0.9.0
oslo.concurrency==3.26.0
oslo.config==5.2.0
oslo.context==2.19.2
oslo.db==4.27.0
oslo.db==4.37.0
oslo.i18n==3.15.3
oslo.log==3.36.0
oslo.messaging==5.29.0

View File

@ -12,7 +12,6 @@
import contextlib
import copy
import inspect
import weakref
from oslo_concurrency import lockutils
@ -148,25 +147,13 @@ def _copy_if_lds(item):
return copy.deepcopy(item) if isinstance(item, (list, dict, set)) else item
# Do retries with some randomness in the backoff, if the version
# of oslo.db supports it.
# TODO(dougwig): remove this gross if/else when lower constraints
# on oslo.db is >= 4.37.0.
if 'jitter' in inspect.getargspec(oslo_db_api.wrap_db_retry.__init__).args:
_retry_db_errors = oslo_db_api.wrap_db_retry(
max_retries=MAX_RETRIES,
retry_interval=0.5,
inc_retry_interval=True,
exception_checker=is_retriable,
jitter=True
)
else:
_retry_db_errors = oslo_db_api.wrap_db_retry(
max_retries=MAX_RETRIES,
retry_interval=0.5,
inc_retry_interval=True,
exception_checker=is_retriable,
)
_retry_db_errors = oslo_db_api.wrap_db_retry(
max_retries=MAX_RETRIES,
retry_interval=0.5,
inc_retry_interval=True,
exception_checker=is_retriable,
jitter=True
)
def retry_db_errors(f):

View File

@ -12,7 +12,7 @@ stevedore>=1.20.0 # Apache-2.0
oslo.concurrency>=3.26.0 # Apache-2.0
oslo.config>=5.2.0 # Apache-2.0
oslo.context>=2.19.2 # Apache-2.0
oslo.db>=4.27.0 # Apache-2.0
oslo.db>=4.37.0 # Apache-2.0
oslo.i18n>=3.15.3 # Apache-2.0
oslo.log>=3.36.0 # Apache-2.0
oslo.messaging>=5.29.0 # Apache-2.0