[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r9054: Fix a longstanding bug in eventdns related to timeouts: The (in tor/trunk: . src/or)



Author: nickm
Date: 2006-12-08 00:59:21 -0500 (Fri, 08 Dec 2006)
New Revision: 9054

Modified:
   tor/trunk/
   tor/trunk/ChangeLog
   tor/trunk/src/or/eventdns.c
Log:
 r11486@Kushana:  nickm | 2006-12-08 00:58:47 -0500
 Fix a longstanding bug in eventdns related to timeouts:  The timeout count was never actually reset to 0.  Argh.  Now we reset it to zero after we get a successful request, or after we notice that a nameserver is back up, or after we decide the nameserver is down because of timeouts.  This may fix bug 326.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r11486] on c95137ef-5f19-0410-b913-86e773d04f59

Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2006-12-08 05:27:13 UTC (rev 9053)
+++ tor/trunk/ChangeLog	2006-12-08 05:59:21 UTC (rev 9054)
@@ -1,5 +1,5 @@
 Changes in version 0.1.2.5-xxxx - 200?-??-??
-  o Minor features
+  o Minor features:
     - Start using the state file to store bandwidth accounting data:
       the bw_accounting file is now obsolete.  We'll keep generating it
       for a while for people who are still using 0.1.2.4-alpha.
@@ -7,7 +7,14 @@
       as possible while still storing important things in a timely
       fashion.
 
-  o Minor bugfixes;
+  o Major bugfixes:
+    - Fix a longstanding bug in eventdns that prevented the count of
+      timed-out resolves from ever being reset.   This bug caused us
+      to give up on a nameserver the third time it timed out, and try it 10
+      seconds later... and to give up on it every time it timed out after
+      that. (May fix bug 326.)
+
+  o Minor bugfixes:
     - Fix a bug when a PF socket is first used.  (Patch from Fabian
       Keil.)
     - Fix an assert failure when the directory authority sets
@@ -26,7 +33,7 @@
     - When generating bandwidth history, round down to the nearest 1k. When
       storing accounting data, round up to the nearest 1k.
 
-  o Controller features
+  o Controller features:
     - Have GETINFO dir/status/* work on hosts with DirPort disabled.
     - Reimplement GETINFO so that info/names stays in sync with the
       actual keys.

Modified: tor/trunk/src/or/eventdns.c
===================================================================
--- tor/trunk/src/or/eventdns.c	2006-12-08 05:27:13 UTC (rev 9053)
+++ tor/trunk/src/or/eventdns.c	2006-12-08 05:59:21 UTC (rev 9054)
@@ -394,7 +394,7 @@
 
 static int global_max_requests_inflight = 64;
 
-static struct timeval global_timeout = {3, 0};	// 3 seconds
+static struct timeval global_timeout = {5, 0};	// 5 seconds
 static int global_max_reissues = 1;	// a reissue occurs when we get some errors from the server
 static int global_max_retransmits = 3;  // number of times we'll retransmit a request which timed out
 // number of timeouts in a row before we consider this server to be down
@@ -628,6 +628,7 @@
 	evtimer_del(&ns->timeout_event);
 	ns->state = 1;
 	ns->failed_times = 0;
+	ns->timedout = 0;
 	global_good_nameservers++;
 }
 
@@ -1080,6 +1081,7 @@
 			nameserver_failed(ns, strerror(err));
 			return;
 		}
+		ns->timedout = 0;
 		reply_parse(packet, r);
 	}
 }
@@ -1241,6 +1243,7 @@
 
 	req->ns->timedout++;
 	if (req->ns->timedout > global_max_nameserver_timeout) {
+        req->ns->timedout = 0;
 		nameserver_failed(req->ns, "request timed out.");
 	}