diff options
author | Erik Johnston <erik@matrix.org> | 2021-03-24 16:13:19 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2021-03-24 16:13:19 +0000 |
commit | f36a060d2cf6fe641a07e26979da47aeedfb8321 (patch) | |
tree | 3a43b0f9149c6d6d845db010e4eb1b215c9bbe79 /synapse | |
parent | Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes (diff) | |
parent | Fixed undefined variable error in catchup (#9664) (diff) | |
download | synapse-f36a060d2cf6fe641a07e26979da47aeedfb8321.tar.xz |
Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes
Diffstat (limited to 'synapse')
-rw-r--r-- | synapse/crypto/context_factory.py | 2 | ||||
-rw-r--r-- | synapse/federation/sender/per_destination_queue.py | 2 | ||||
-rw-r--r-- | synapse/logging/context.py | 2 | ||||
-rw-r--r-- | synapse/storage/database.py | 2 | ||||
-rw-r--r-- | synapse/util/async_helpers.py | 2 | ||||
-rw-r--r-- | synapse/util/caches/__init__.py | 2 |
6 files changed, 7 insertions, 5 deletions
diff --git a/synapse/crypto/context_factory.py b/synapse/crypto/context_factory.py index 4ca13011e5..c644b4dfc5 100644 --- a/synapse/crypto/context_factory.py +++ b/synapse/crypto/context_factory.py @@ -191,7 +191,7 @@ def _context_info_cb(ssl_connection, where, ret): # ... we further assume that SSLClientConnectionCreator has set the # '_synapse_tls_verifier' attribute to a ConnectionVerifier object. tls_protocol._synapse_tls_verifier.verify_context_info_cb(ssl_connection, where) - except: # noqa: E722, taken from the twisted implementation + except BaseException: # taken from the twisted implementation logger.exception("Error during info_callback") f = Failure() tls_protocol.failVerification(f) diff --git a/synapse/federation/sender/per_destination_queue.py b/synapse/federation/sender/per_destination_queue.py index af85fe0a1e..89df9a619b 100644 --- a/synapse/federation/sender/per_destination_queue.py +++ b/synapse/federation/sender/per_destination_queue.py @@ -480,6 +480,8 @@ class PerDestinationQueue: # the other sending servers are up). if new_pdus: room_catchup_pdus = new_pdus + else: + room_catchup_pdus = [pdu] logger.info( "Catching up rooms to %s: %r", self._destination, pdu.room_id diff --git a/synapse/logging/context.py b/synapse/logging/context.py index 1a7ea4fa96..03cf3c2b8e 100644 --- a/synapse/logging/context.py +++ b/synapse/logging/context.py @@ -689,7 +689,7 @@ def run_in_background(f, *args, **kwargs) -> defer.Deferred: current = current_context() try: res = f(*args, **kwargs) - except: # noqa: E722 + except Exception: # the assumption here is that the caller doesn't want to be disturbed # by synchronous exceptions, so let's turn them into Failures. return defer.fail() diff --git a/synapse/storage/database.py b/synapse/storage/database.py index f1ba529a2d..5b0b9a20bf 100644 --- a/synapse/storage/database.py +++ b/synapse/storage/database.py @@ -670,7 +670,7 @@ class DatabasePool: for after_callback, after_args, after_kwargs in after_callbacks: after_callback(*after_args, **after_kwargs) - except: # noqa: E722, as we reraise the exception this is fine. + except Exception: for after_callback, after_args, after_kwargs in exception_callbacks: after_callback(*after_args, **after_kwargs) raise diff --git a/synapse/util/async_helpers.py b/synapse/util/async_helpers.py index f33c115844..c3b2d981ea 100644 --- a/synapse/util/async_helpers.py +++ b/synapse/util/async_helpers.py @@ -496,7 +496,7 @@ def timeout_deferred( try: deferred.cancel() - except: # noqa: E722, if we throw any exception it'll break time outs + except Exception: # if we throw any exception it'll break time outs logger.exception("Canceller failed during timeout") # the cancel() call should have set off a chain of errbacks which diff --git a/synapse/util/caches/__init__.py b/synapse/util/caches/__init__.py index e676c2cac4..f968706334 100644 --- a/synapse/util/caches/__init__.py +++ b/synapse/util/caches/__init__.py @@ -116,7 +116,7 @@ def register_cache( """ if resizable: if not resize_callback: - resize_callback = getattr(cache, "set_cache_factor") + resize_callback = cache.set_cache_factor # type: ignore add_resizable_cache(cache_name, resize_callback) metric = CacheMetric(cache, cache_type, cache_name, collect_callback) |