You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
while self.running and self.socket is None and (connect_count < self.__reconnect_attempts_max or
self.__reconnect_attempts_max == -1):
for host_and_port in self.__host_and_ports:
try:
...
+ except FileNotFoundError as err:+ logging.error("Could not find file %s", err.filename)+ self.socket = None+ break
except (OSError, AssertionError):
self.socket = None
connect_count += 1
logging.warning("could not connect to host %s, port %s", host_and_port[0], host_and_port[1],
exc_info=logging.verbose)
Since we are not updating the connect_count and the break is jumping out of the for into the while loop, if for some reason we hit that exception, we will keep retrying until the file exists, which might never happen.
It looks like we need either connect_count += 1, or we could do connect_count = self.__reconnect_attempts_max if we don't think it's a recoverable exception.
The text was updated successfully, but these errors were encountered:
Hi, thanks for the great library!
It seems #438 introduced a small bug.
Since we are not updating the
connect_count
and thebreak
is jumping out of thefor
into thewhile
loop, if for some reason we hit that exception, we will keep retrying until the file exists, which might never happen.It looks like we need either
connect_count += 1
, or we could doconnect_count = self.__reconnect_attempts_max
if we don't think it's a recoverable exception.The text was updated successfully, but these errors were encountered: