diff options
author | Erik Johnston <erik@matrix.org> | 2017-04-10 11:32:05 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2017-04-10 11:32:05 +0100 |
commit | 0364d2321023fb68ecafb82ede21fa64334593f3 (patch) | |
tree | e9d32c65c225562f73e2ba7263f3c10edef281c3 /synapse/replication/tcp/protocol.py | |
parent | Merge pull request #2108 from matrix-org/erikj/current_state_ids (diff) | |
download | synapse-0364d2321023fb68ecafb82ede21fa64334593f3.tar.xz |
Up replication ping timeout
Diffstat (limited to '')
-rw-r--r-- | synapse/replication/tcp/protocol.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/replication/tcp/protocol.py b/synapse/replication/tcp/protocol.py index 19b1ce504f..5770b7125a 100644 --- a/synapse/replication/tcp/protocol.py +++ b/synapse/replication/tcp/protocol.py @@ -85,6 +85,8 @@ logger = logging.getLogger(__name__) PING_TIME = 5000 +PING_TIMEOUT_MULTIPLIER = 5 +PING_TIMEOUT_MS = PING_TIME * PING_TIMEOUT_MULTIPLIER class ConnectionStates(object): @@ -166,7 +168,7 @@ class BaseReplicationStreamProtocol(LineOnlyReceiver): now = self.clock.time_msec() if self.time_we_closed: - if now - self.time_we_closed > PING_TIME * 3: + if now - self.time_we_closed > PING_TIMEOUT_MS: logger.info( "[%s] Failed to close connection gracefully, aborting", self.id() ) @@ -175,7 +177,7 @@ class BaseReplicationStreamProtocol(LineOnlyReceiver): if now - self.last_sent_command >= PING_TIME: self.send_command(PingCommand(now)) - if self.received_ping and now - self.last_received_command > PING_TIME * 3: + if self.received_ping and now - self.last_received_command > PING_TIMEOUT_MS: logger.info( "[%s] Connection hasn't received command in %r ms. Closing.", self.id(), now - self.last_received_command |