summaryrefslogtreecommitdiff
path: root/oslo_db/api.py
diff options
context:
space:
mode:
authorEugene Nikanorov <enikanorov@mirantis.com>2015-03-17 14:17:41 +0300
committerEugene Nikanorov <enikanorov@mirantis.com>2015-03-17 14:17:41 +0300
commit02aeda28cf8b69f39f934a3e80cb7cae04c5fc20 (patch)
tree4f4918ddbc16d1de55c20671a6034cf376734f9c /oslo_db/api.py
parentde9439c457dc865d2192684f0292d59674afc785 (diff)
downloadoslo-db-02aeda28cf8b69f39f934a3e80cb7cae04c5fc20.tar.gz
Avoid excessing logging of RetryRequest exception
Such exception indicates of error condition only if retries are exceeded. In other cases error-level logs pollute the log file and complicate log analysis. Change-Id: I318867043a68a6499851631593859a0fffac6038 Closes-Bug: #1433001
Diffstat (limited to 'oslo_db/api.py')
-rw-r--r--oslo_db/api.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/oslo_db/api.py b/oslo_db/api.py
index 616cac5..0ba07e8 100644
--- a/oslo_db/api.py
+++ b/oslo_db/api.py
@@ -139,7 +139,11 @@ class wrap_db_retry(object):
raise e
if remaining != -1:
remaining -= 1
- LOG.exception(_LE('DB error.'))
+ # RetryRequest is application-initated exception
+ # and not an error condition in case retries are
+ # not exceeded
+ if not isinstance(e, exception.RetryRequest):
+ LOG.exception(_LE('DB error.'))
# NOTE(vsergeyev): We are using patched time module, so
# this effectively yields the execution
# context to another green thread.