Instrumentation to pin down laurentb's timeout bug.
authorEric S. Raymond <esr@thyrsus.com>
Sun, 7 Oct 2012 16:24:36 +0000 (12:24 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Sun, 7 Oct 2012 16:24:36 +0000 (12:24 -0400)
irkerd

diff --git a/irkerd b/irkerd
index 321bb5ff1a710a2065c01b09036a2cf7f0a8b527..1fe96a119e68d61b287fd8649fa0db7312fadfb9 100755 (executable)
--- a/irkerd
+++ b/irkerd
@@ -185,10 +185,10 @@ class Connection:
                     # the connection rather than holding a socket open in
                     # the server forever.
                     now = time.time()
-                    if (now > self.last_xmit + XMIT_TTL \
-                           or now > self.last_ping + PING_TTL) \
-                           and self.status != "disconnected":
-                        self.irker.debug(1, "timing out inactive connection to %s at %s" % (self.servername, time.asctime()))
+                    xmit_timeout = now > self.last_xmit + XMIT_TTL
+                    ping_timeout = now > self.last_ping + PING_TTL
+                    if (xmit_timeout or ping_timeout) and self.status != "disconnected":
+                        self.irker.debug(1, "timing out connection to %s at %s (ping_timeout=%s, xmit_timeout=%s)" % (self.servername, time.asctime(), ping_timeout, xmit_timeout))
                         self.connection.context = None
                         self.connection.quit("transmission timeout")
                         self.connection.close()