summary refs log tree commit diff
path: root/synapse/storage/databases/main/lock.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2021-07-28 10:36:55 +0100
committerAndrew Morgan <andrew@amorgan.xyz>2021-07-28 10:36:55 +0100
commit1d3a9fe6e5cec793e7e259cf7e469fd4c8d79041 (patch)
tree7362257c5ff8e37b52334d06ab55d85fabc2dce8 /synapse/storage/databases/main/lock.py
parentMerge remote-tracking branch 'origin/release-v1.38' into matrix-org-hotfixes (diff)
parentFix import of the default SAML mapping provider. (#10477) (diff)
downloadsynapse-1d3a9fe6e5cec793e7e259cf7e469fd4c8d79041.tar.xz
Merge branch 'release-v1.39' of github.com:matrix-org/synapse into matrix-org-hotfixes
Diffstat (limited to 'synapse/storage/databases/main/lock.py')
-rw-r--r--synapse/storage/databases/main/lock.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/synapse/storage/databases/main/lock.py b/synapse/storage/databases/main/lock.py

index 774861074c..3d1dff660b 100644 --- a/synapse/storage/databases/main/lock.py +++ b/synapse/storage/databases/main/lock.py
@@ -78,7 +78,11 @@ class LockStore(SQLBaseStore): """Called when the server is shutting down""" logger.info("Dropping held locks due to shutdown") - for (lock_name, lock_key), token in self._live_tokens.items(): + # We need to take a copy of the tokens dict as dropping the locks will + # cause the dictionary to change. + tokens = dict(self._live_tokens) + + for (lock_name, lock_key), token in tokens.items(): await self._drop_lock(lock_name, lock_key, token) logger.info("Dropped locks due to shutdown")