diff --git a/tor-daemon/tor-daemon.py b/tor-daemon/tor-daemon.py
--- a/tor-daemon/tor-daemon.py
+++ b/tor-daemon/tor-daemon.py
#
@@ -11,6 +11,7 @@ import datetime
#
CONTROL_H = os.getenv("CONTROL_HOST", "127.0.0.1")
#
CONTROL_P = int(os.getenv("CONTROL_PORT", 9051))
#
@@ -50,6 +51,23 @@ def send_and_respond(sock, command):
#
res.append(data.decode())
#
+ except socket.timeout as e:
#
+ if e.args[0] == "timed out":
#
+ # Wait a little longer
#
+ # Looks like we got our read
#
+ except socket.error as e:
#
except BlockingIOError:
#
@@ -469,7 +487,8 @@ state = {
#
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
#
s.connect((CONTROL_H, int(CONTROL_P)))
#
+ # set a read timeout of 0.2s
#
state["stats_failures"] += 1
#
state["tags"].append(["failure_type", "connection"])