mirror of
https://github.com/xcat2/confluent.git
synced 2025-07-15 17:16:11 +00:00
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.
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user