Fix "limbo" state in the re-connection cycle

Changed the logic for determining when to “re-connect” to the master.
This will break if the ping timeout is set too low. Recommend keeping
it at 4-5 seconds.
This commit is contained in:
Cort Buffington 2018-02-12 12:16:56 -06:00
parent fbe7862faa
commit afd1370143
1 changed files with 1 additions and 1 deletions

View File

@ -157,7 +157,7 @@ class HBSYSTEM(DatagramProtocol):
if self._stats['PING_OUTSTANDING']:
self._stats['NUM_OUTSTANDING'] += 1
# If we're not connected, zero out the stats and send a login request RPTL
if self._stats['CONNECTION'] == 'NO' or self._stats['CONNECTION'] == 'RPTL_SENT' or self._stats['NUM_OUTSTANDING'] >= self._CONFIG['GLOBAL']['MAX_MISSED']:
if self._stats['CONNECTION'] != 'YES' or self._stats['NUM_OUTSTANDING'] >= self._CONFIG['GLOBAL']['MAX_MISSED']:
self._stats['PINGS_SENT'] = 0
self._stats['PINGS_ACKD'] = 0
self._stats['NUM_OUTSTANDING'] = 0