mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-05-06 15:05:03 -04:00
Stop the master relaying USER_SYNC for other workers (#7318)
Long story short: if we're handling presence on the current worker, we shouldn't be sending USER_SYNC commands over replication. In an attempt to figure out what is going on here, I ended up refactoring some bits of the presencehandler code, so the first 4 commits here are non-functional refactors to move this code slightly closer to sanity. (There's still plenty to do here :/). Suggest reviewing individual commits. Fixes (I hope) #7257.
This commit is contained in:
parent
841c581c40
commit
71a1abb8a1
10 changed files with 199 additions and 159 deletions
|
@ -337,13 +337,6 @@ class ReplicationCommandHandler:
|
|||
if self._is_master:
|
||||
self._notifier.notify_remote_server_up(cmd.data)
|
||||
|
||||
def get_currently_syncing_users(self):
|
||||
"""Get the list of currently syncing users (if any). This is called
|
||||
when a connection has been established and we need to send the
|
||||
currently syncing users.
|
||||
"""
|
||||
return self._presence_handler.get_currently_syncing_users()
|
||||
|
||||
def new_connection(self, connection: AbstractConnection):
|
||||
"""Called when we have a new connection.
|
||||
"""
|
||||
|
@ -361,9 +354,11 @@ class ReplicationCommandHandler:
|
|||
if self._factory:
|
||||
self._factory.resetDelay()
|
||||
|
||||
# Tell the server if we have any users currently syncing (should only
|
||||
# happen on synchrotrons)
|
||||
currently_syncing = self.get_currently_syncing_users()
|
||||
# Tell the other end if we have any users currently syncing.
|
||||
currently_syncing = (
|
||||
self._presence_handler.get_currently_syncing_users_for_replication()
|
||||
)
|
||||
|
||||
now = self._clock.time_msec()
|
||||
for user_id in currently_syncing:
|
||||
connection.send_command(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue