diff options
author | Erik Johnston <erik@matrix.org> | 2020-04-29 14:10:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-29 14:10:59 +0100 |
commit | 3eab76ad43e1de4074550c468d11318d497ff632 (patch) | |
tree | 919ff2563327b2cef97a1c1625122fdc4fe7815f /synapse/notifier.py | |
parent | Fix limit logic for EventsStream (#7358) (diff) | |
download | synapse-3eab76ad43e1de4074550c468d11318d497ff632.tar.xz |
Don't relay REMOTE_SERVER_UP cmds to same conn. (#7352)
For direct TCP connections we need the master to relay REMOTE_SERVER_UP commands to the other connections so that all instances get notified about it. The old implementation just relayed to all connections, assuming that sending back to the original sender of the command was safe. This is not true for redis, where commands sent get echoed back to the sender, which was causing master to effectively infinite loop sending and then re-receiving REMOTE_SERVER_UP commands that it sent. The fix is to ensure that we only relay to *other* connections and not to the connection we received the notification from. Fixes #7334.
Diffstat (limited to 'synapse/notifier.py')
-rw-r--r-- | synapse/notifier.py | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/synapse/notifier.py b/synapse/notifier.py index 6132727cbd..88a5a97caf 100644 --- a/synapse/notifier.py +++ b/synapse/notifier.py @@ -220,12 +220,6 @@ class Notifier(object): """ self.replication_callbacks.append(cb) - def add_remote_server_up_callback(self, cb: Callable[[str], None]): - """Add a callback that will be called when synapse detects a server - has been - """ - self.remote_server_up_callbacks.append(cb) - def on_new_room_event( self, event, room_stream_id, max_room_stream_id, extra_users=[] ): @@ -544,6 +538,3 @@ class Notifier(object): # circular dependencies. if self.federation_sender: self.federation_sender.wake_destination(server) - - for cb in self.remote_server_up_callbacks: - cb(server) |