From afd1370143136569ebdbf30f0c582160fa3d33f7 Mon Sep 17 00:00:00 2001 From: Cort Buffington Date: Mon, 12 Feb 2018 12:16:56 -0600 Subject: [PATCH] Fix "limbo" state in the re-connection cycle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- hblink.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hblink.py b/hblink.py index 0d76aff..5529feb 100755 --- a/hblink.py +++ b/hblink.py @@ -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