[or-cvs] r12033: When we have plenty of directory information, don't try to l (in tor/trunk: . src/or)

nickm at seul.org nickm at seul.org
Thu Oct 18 19:51:14 UTC 2007


Author: nickm
Date: 2007-10-18 15:51:14 -0400 (Thu, 18 Oct 2007)
New Revision: 12033

Modified:
   tor/trunk/
   tor/trunk/ChangeLog
   tor/trunk/src/or/main.c
Log:
 r15934 at catbus:  nickm | 2007-10-18 15:32:56 -0400
 When we have plenty of directory information, don't try to launch descriptor downloads quite so eagerly.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r15934] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2007-10-18 19:24:05 UTC (rev 12032)
+++ tor/trunk/ChangeLog	2007-10-18 19:51:14 UTC (rev 12033)
@@ -19,6 +19,8 @@
   o Minor features (performance):
     - Call routerlist_remove_old_routers() much less often.  This should
       speed startup, especially on directory caches.
+    - Don't try to launch descriptor downloads quite so often when we
+      have enough directory information.
 
   o Minor bugfixes (directory authorities):
     - Correct the implementation of "download votes by digest."  Bugfix on

Modified: tor/trunk/src/or/main.c
===================================================================
--- tor/trunk/src/or/main.c	2007-10-18 19:24:05 UTC (rev 12032)
+++ tor/trunk/src/or/main.c	2007-10-18 19:51:14 UTC (rev 12033)
@@ -98,8 +98,12 @@
 /** How often do we check buffers and pools for empty space that can be
  * deallocated? */
 #define MEM_SHRINK_INTERVAL (60)
-/** How often do we check for router descriptors that we should download? */
-#define DESCRIPTOR_RETRY_INTERVAL (10)
+/** How often do we check for router descriptors that we should download
+ * when we have too little directory info? */
+#define GREEDY_DESCRIPTOR_RETRY_INTERVAL (10)
+/** How often do we check for router descriptors that we should download
+ * when we have enough directory info? */
+#define LAZY_DESCRIPTOR_RETRY_INTERVAL (60)
 /** How often do we 'forgive' undownloadable router descriptors and attempt
  * to download them again? */
 #define DESCRIPTOR_FAILURE_RESET_INTERVAL (60*60)
@@ -859,13 +863,14 @@
   }
 
   if (time_to_try_getting_descriptors < now) {
-    /* XXXX  Maybe we should do this every 10sec when not enough info,
-     * and every 60sec when we have enough info -NM Great idea -RD */
     update_router_descriptor_downloads(now);
     update_extrainfo_downloads(now);
     if (options->UseBridges)
       fetch_bridge_descriptors(now);
-    time_to_try_getting_descriptors = now + DESCRIPTOR_RETRY_INTERVAL;
+    if (router_have_minimum_dir_info())
+      time_to_try_getting_descriptors = now + LAZY_DESCRIPTOR_RETRY_INTERVAL;
+    else
+      time_to_try_getting_descriptors = now + GREEDY_DESCRIPTOR_RETRY_INTERVAL;
   }
 
   if (time_to_reset_descriptor_failures < now) {



More information about the tor-commits mailing list