fix: retry connection on network error instead of permanently dropping it
error_received() no longer sets _dead=True; it just closes the transport so the existing retry loop in heartbeat_sender (hbc) and sendto (hbc_mini) reopens the connection on the next interval. This allows hbc to recover when it starts before network connectivity is established. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+1
-2
@@ -797,8 +797,7 @@ class _HeartbeatProtocol(asyncio.DatagramProtocol):
|
||||
self._log.error("datagram error: %s", e)
|
||||
|
||||
def error_received(self, exc):
|
||||
self._log.warning("protocol error on %s: %s — dropping connection", self._conn.addr, exc)
|
||||
self._conn._dead = True
|
||||
self._log.warning("protocol error on %s: %s — will retry", self._conn.addr, exc)
|
||||
self._conn.close()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user