From 2a3ec6facf79f6aae011d9fb6f9ed5e43c7b6bec Mon Sep 17 00:00:00 2001 From: David Robertson Date: Tue, 7 Dec 2021 12:34:38 +0000 Subject: [PATCH] Correctly register shutdown handler for presence workers (#11518) Fixes #11517 --- changelog.d/11518.bugfix | 1 + synapse/handlers/presence.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog.d/11518.bugfix diff --git a/changelog.d/11518.bugfix b/changelog.d/11518.bugfix new file mode 100644 index 000000000..3c27382c7 --- /dev/null +++ b/changelog.d/11518.bugfix @@ -0,0 +1 @@ +Fix a regression in Synapse 1.48.0 where presence workers would not clear their presence updates over replication on shutdown. diff --git a/synapse/handlers/presence.py b/synapse/handlers/presence.py index 3df872c57..454d06c97 100644 --- a/synapse/handlers/presence.py +++ b/synapse/handlers/presence.py @@ -421,7 +421,7 @@ class WorkerPresenceHandler(BasePresenceHandler): self._on_shutdown, ) - def _on_shutdown(self) -> None: + async def _on_shutdown(self) -> None: if self._presence_enabled: self.hs.get_tcp_replication().send_command( ClearUserSyncsCommand(self.instance_id)