From d9e47824a416176092c7e58e271fede1723b0014 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 11 May 2016 13:33:36 -0400 Subject: [PATCH] Backoff automatic reconnect interval Previously, offline nodes would be rechecked automatically on average every 45 seconds. Extend this to on average 180 seconds, to reduce ARP traffic significantly when there are a large volume of undefined nodes. The 'try to connect on open' behavior is retained, so this would mean a longer loss of connectivity only in a background monitored session. --- confluent_server/confluent/consoleserver.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/confluent_server/confluent/consoleserver.py b/confluent_server/confluent/consoleserver.py index 0a88bc62..c93b1c50 100644 --- a/confluent_server/confluent/consoleserver.py +++ b/confluent_server/confluent/consoleserver.py @@ -221,7 +221,7 @@ class ConsoleHandler(object): self.connectstate = 'unconnected' self._send_rcpts({'connectstate': self.connectstate, 'error': self.error}) - retrytime = 30 + (30 * random.random()) + retrytime = 120 + (120 * random.random()) if not self.reconnect: self.reconnect = eventlet.spawn_after(retrytime, self._connect) return @@ -230,7 +230,7 @@ class ConsoleHandler(object): self.connectstate = 'unconnected' self._send_rcpts({'connectstate': self.connectstate, 'error': self.error}) - retrytime = 30 + (30 * random.random()) + retrytime = 120 + (120 * random.random()) if not self.reconnect: self.reconnect = eventlet.spawn_after(retrytime, self._connect) return @@ -241,7 +241,7 @@ class ConsoleHandler(object): self.connectstate = 'unconnected' self._send_rcpts({'connectstate': self.connectstate, 'error': self.error}) - retrytime = 30 + (30 * random.random()) + retrytime = 120 + (120 * random.random()) if not self.reconnect: self.reconnect = eventlet.spawn_after(retrytime, self._connect) return