summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--oslo_db/api.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/oslo_db/api.py b/oslo_db/api.py
index 6a58394..93931f7 100644
--- a/oslo_db/api.py
+++ b/oslo_db/api.py
@@ -139,10 +139,12 @@ class wrap_db_retry(object):
return f(*args, **kwargs)
except Exception as e:
with excutils.save_and_reraise_exception() as ectxt:
+ expected = self._is_exception_expected(e)
if remaining > 0:
- ectxt.reraise = not self._is_exception_expected(e)
+ ectxt.reraise = not expected
else:
- LOG.exception(_LE('DB exceeded retry limit.'))
+ if expected:
+ LOG.exception(_LE('DB exceeded retry limit.'))
# if it's a RetryRequest, we need to unpack it
if isinstance(e, exception.RetryRequest):
ectxt.type_ = type(e.inner_exc)