Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/4929.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix `ClientReplicationStreamProtocol.__str__()`.
8 changes: 5 additions & 3 deletions synapse/replication/tcp/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,11 @@ def on_connection_closed(self):
self.transport.unregisterProducer()

def __str__(self):
addr = None
if self.transport:
addr = str(self.transport.getPeer())
return "ReplicationConnection<name=%s,conn_id=%s,addr=%s>" % (
self.name, self.conn_id, self.addr,
self.name, self.conn_id, addr,
)

def id(self):
Expand All @@ -381,12 +384,11 @@ class ServerReplicationStreamProtocol(BaseReplicationStreamProtocol):
VALID_INBOUND_COMMANDS = VALID_CLIENT_COMMANDS
VALID_OUTBOUND_COMMANDS = VALID_SERVER_COMMANDS

def __init__(self, server_name, clock, streamer, addr):
def __init__(self, server_name, clock, streamer):
BaseReplicationStreamProtocol.__init__(self, clock) # Old style class

self.server_name = server_name
self.streamer = streamer
self.addr = addr

# The streams the client has subscribed to and is up to date with
self.replication_streams = set()
Expand Down
1 change: 0 additions & 1 deletion synapse/replication/tcp/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ def buildProtocol(self, addr):
self.server_name,
self.clock,
self.streamer,
addr
)


Expand Down