diff options
author | Neil Johnson <neil@matrix.org> | 2019-01-07 15:48:06 +0000 |
---|---|---|
committer | Neil Johnson <neil@matrix.org> | 2019-01-07 15:48:06 +0000 |
commit | 1e78846664897e0bb8730f4b18ebee93d128f6cb (patch) | |
tree | 0a854f14201234c134aff8defc95f47b37b8fe0b | |
parent | Add GET account data routes (#4303) (diff) | |
download | synapse-github/neilj/improve_logg_for_4239.tar.xz |
reraise exceptions and raise logging level on except github/neilj/improve_logg_for_4239 neilj/improve_logg_for_4239
-rw-r--r-- | changelog.d/4354.bugfix | 1 | ||||
-rw-r--r-- | synapse/storage/_base.py | 8 |
2 files changed, 5 insertions, 4 deletions
diff --git a/changelog.d/4354.bugfix b/changelog.d/4354.bugfix new file mode 100644 index 0000000000..f6b5ef961b --- /dev/null +++ b/changelog.d/4354.bugfix @@ -0,0 +1 @@ +Improve logging to synapse.storage._base._new_transaction not to swallow exceptions diff --git a/synapse/storage/_base.py b/synapse/storage/_base.py index 1d3069b143..53d86d5bb9 100644 --- a/synapse/storage/_base.py +++ b/synapse/storage/_base.py @@ -264,7 +264,7 @@ class SQLBaseStore(object): name, exception_to_unicode(e1), ) continue - raise + raise e except self.database_engine.module.DatabaseError as e: if self.database_engine.is_deadlock(e): logger.warning("[TXN DEADLOCK] {%s} %d/%d", name, i, N) @@ -278,10 +278,10 @@ class SQLBaseStore(object): name, exception_to_unicode(e1), ) continue - raise + raise e except Exception as e: - logger.debug("[TXN FAIL] {%s} %s", name, e) - raise + logger.exception("[TXN FAIL] {%s} %s", name, exception_to_unicode(e)) + raise e finally: end = time.time() duration = end - start |