From 1579fdd54a9aab6b65ddb8de4e83b61c3384e2fe Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Fri, 9 Jul 2021 10:16:54 +0100 Subject: Ensure we always drop the federation inbound lock (#10336) --- synapse/federation/federation_server.py | 1 + synapse/storage/databases/main/lock.py | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'synapse') diff --git a/synapse/federation/federation_server.py b/synapse/federation/federation_server.py index bf67d0f574..ac0f2ccfb3 100644 --- a/synapse/federation/federation_server.py +++ b/synapse/federation/federation_server.py @@ -949,6 +949,7 @@ class FederationServer(FederationBase): room_id, room_version ) if not next: + await lock.release() return origin, event = next diff --git a/synapse/storage/databases/main/lock.py b/synapse/storage/databases/main/lock.py index e76188328c..774861074c 100644 --- a/synapse/storage/databases/main/lock.py +++ b/synapse/storage/databases/main/lock.py @@ -310,14 +310,25 @@ class Lock: _excinst: Optional[BaseException], _exctb: Optional[TracebackType], ) -> bool: + await self.release() + + return False + + async def release(self) -> None: + """Release the lock. + + This is automatically called when using the lock as a context manager. + """ + + if self._dropped: + return + if self._looping_call.running: self._looping_call.stop() await self._store._drop_lock(self._lock_name, self._lock_key, self._token) self._dropped = True - return False - def __del__(self) -> None: if not self._dropped: # We should not be dropped without the lock being released (unless -- cgit 1.5.1 From 717a07b73fec1a63a716c3ad33f3dbd2de05b06d Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Fri, 9 Jul 2021 10:59:28 +0100 Subject: 1.38.0rc2 --- CHANGES.md | 16 ++++++++++++++++ changelog.d/10287.doc | 1 - changelog.d/10331.doc | 1 - changelog.d/10336.bugfix | 1 - synapse/__init__.py | 2 +- 5 files changed, 17 insertions(+), 4 deletions(-) delete mode 100644 changelog.d/10287.doc delete mode 100644 changelog.d/10331.doc delete mode 100644 changelog.d/10336.bugfix (limited to 'synapse') diff --git a/CHANGES.md b/CHANGES.md index c930b48b25..cd26ca3c4c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,19 @@ +Synapse 1.38.0rc2 (2021-07-09) +============================== + +Bugfixes +-------- + +- Fix bug where inbound federation in a room could be delayed due to not correctly dropping a lock. Introduced in v1.37.1. ([\#10336](https://github.com/matrix-org/synapse/issues/10336)) + + +Improved Documentation +---------------------- + +- Update links to documentation in sample config. Contributed by @dklimpel. ([\#10287](https://github.com/matrix-org/synapse/issues/10287)) +- Fix broken links in INSTALL.md. Contributed by @dklimpel. ([\#10331](https://github.com/matrix-org/synapse/issues/10331)) + + Synapse 1.38.0rc1 (2021-07-06) ============================== diff --git a/changelog.d/10287.doc b/changelog.d/10287.doc deleted file mode 100644 index d62afc1e15..0000000000 --- a/changelog.d/10287.doc +++ /dev/null @@ -1 +0,0 @@ -Update links to documentation in sample config. Contributed by @dklimpel. diff --git a/changelog.d/10331.doc b/changelog.d/10331.doc deleted file mode 100644 index 9b9acd9007..0000000000 --- a/changelog.d/10331.doc +++ /dev/null @@ -1 +0,0 @@ -Fix broken links in INSTALL.md. Contributed by @dklimpel. diff --git a/changelog.d/10336.bugfix b/changelog.d/10336.bugfix deleted file mode 100644 index 5e75ed3335..0000000000 --- a/changelog.d/10336.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fix bug where inbound federation in a room could be delayed due to not correctly dropping a lock. Introduced in v1.37.1. diff --git a/synapse/__init__.py b/synapse/__init__.py index aa9a3269c0..119afa9ebe 100644 --- a/synapse/__init__.py +++ b/synapse/__init__.py @@ -47,7 +47,7 @@ try: except ImportError: pass -__version__ = "1.38.0rc1" +__version__ = "1.38.0rc2" if bool(os.environ.get("SYNAPSE_TEST_PATCH_LOG_CONTEXTS", False)): # We import here so that we don't have to install a bunch of deps when -- cgit 1.5.1