Merge "RetryDecorator should not log warnings/errors for expected exceptions"
This commit is contained in:
commit
0bec9aa589
@ -247,18 +247,17 @@ class RetryDecorator(object):
|
|||||||
result = f(*args, **kwargs)
|
result = f(*args, **kwargs)
|
||||||
except self._exceptions:
|
except self._exceptions:
|
||||||
with excutils.save_and_reraise_exception() as ctxt:
|
with excutils.save_and_reraise_exception() as ctxt:
|
||||||
LOG.warn(_LW("Exception which is in the suggested list of "
|
LOG.debug("Exception which is in the suggested list of "
|
||||||
"exceptions occurred while invoking function:"
|
"exceptions occurred while invoking function:"
|
||||||
" %s."),
|
" %s.",
|
||||||
func_name,
|
func_name)
|
||||||
exc_info=True)
|
|
||||||
if (self._max_retry_count != -1 and
|
if (self._max_retry_count != -1 and
|
||||||
self._retry_count >= self._max_retry_count):
|
self._retry_count >= self._max_retry_count):
|
||||||
LOG.error(_LE("Cannot retry %(func_name)s upon "
|
LOG.debug("Cannot retry %(func_name)s upon "
|
||||||
"suggested exception "
|
"suggested exception "
|
||||||
"since retry count (%(retry_count)d) "
|
"since retry count (%(retry_count)d) "
|
||||||
"reached max retry count "
|
"reached max retry count "
|
||||||
"(%(max_retry_count)d)."),
|
"(%(max_retry_count)d).",
|
||||||
{'retry_count': self._retry_count,
|
{'retry_count': self._retry_count,
|
||||||
'max_retry_count': self._max_retry_count,
|
'max_retry_count': self._max_retry_count,
|
||||||
'func_name': func_name})
|
'func_name': func_name})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user