summary refs log tree commit diff
diff options
context:
space:
mode:
authorStanislav Kazantsev <stas.kazancev54@gmail.com>2025-05-15 23:18:17 +0600
committerGitHub <noreply@github.com>2025-05-15 18:18:17 +0100
commit0afdc0fc7ffe2cb7a2fa6d47f22b685cbacc7223 (patch)
treea9a17938b7504945169c0f7049dc2fffc9a7c39f
parentAdd option to allow registrations that begin with '_' (#18262) (diff)
downloadsynapse-0afdc0fc7ffe2cb7a2fa6d47f22b685cbacc7223.tar.xz
remove room without listeners from Notifier.room_to_user_streams (#18380)
Co-authored-by: Andrew Morgan <andrew@amorgan.xyz>
-rw-r--r--changelog.d/18380.misc1
-rw-r--r--synapse/notifier.py3
2 files changed, 4 insertions, 0 deletions
diff --git a/changelog.d/18380.misc b/changelog.d/18380.misc
new file mode 100644

index 0000000000..5d6017be26 --- /dev/null +++ b/changelog.d/18380.misc
@@ -0,0 +1 @@ +Fix a memory leak in `_NotifierUserStream`. \ No newline at end of file diff --git a/synapse/notifier.py b/synapse/notifier.py
index 1914d0c914..6190432b87 100644 --- a/synapse/notifier.py +++ b/synapse/notifier.py
@@ -158,6 +158,9 @@ class _NotifierUserStream: lst = notifier.room_to_user_streams.get(room, set()) lst.discard(self) + if not lst: + notifier.room_to_user_streams.pop(room, None) + notifier.user_to_user_stream.pop(self.user_id) def count_listeners(self) -> int: