diff options
author | Mathieu Velten <mathieuv@matrix.org> | 2023-08-16 16:19:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-16 16:19:54 +0200 |
commit | 8c3bcea2da4939e21a99f72d6c3995186bc4b80d (patch) | |
tree | eee47996c192118ab4f0b3af9b50de3d095fb65b /synapse/handlers/worker_lock.py | |
parent | Add link explaining ELK stack to structured_logging.md (#16091) (diff) | |
download | synapse-8c3bcea2da4939e21a99f72d6c3995186bc4b80d.tar.xz |
Rename pagination&purge locks and add comments explaining them (#16112)
Diffstat (limited to 'synapse/handlers/worker_lock.py')
-rw-r--r-- | synapse/handlers/worker_lock.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/synapse/handlers/worker_lock.py b/synapse/handlers/worker_lock.py index 72df773a86..58efe7116b 100644 --- a/synapse/handlers/worker_lock.py +++ b/synapse/handlers/worker_lock.py @@ -42,7 +42,11 @@ if TYPE_CHECKING: from synapse.server import HomeServer -DELETE_ROOM_LOCK_NAME = "delete_room_lock" +# This lock is used to avoid creating an event while we are purging the room. +# We take a read lock when creating an event, and a write one when purging a room. +# This is because it is fine to create several events concurrently, since referenced events +# will not disappear under our feet as long as we don't delete the room. +NEW_EVENT_DURING_PURGE_LOCK_NAME = "new_event_during_purge_lock" class WorkerLocksHandler: |