[or-cvs] [tor/master] stop authority reachability check on startup

arma at torproject.org arma at torproject.org
Wed Apr 21 08:28:47 UTC 2010


Author: Roger Dingledine <arma at torproject.org>
Date: Wed, 21 Apr 2010 04:27:56 -0400
Subject: stop authority reachability check on startup
Commit: 6952b445cc121148eed87a12536cec8522f7d136

---
 changes/no_reachability_test_on_startup |    6 ++++++
 src/or/dirserv.c                        |   10 ++++------
 src/or/main.c                           |    7 +------
 src/or/or.h                             |    2 +-
 4 files changed, 12 insertions(+), 13 deletions(-)
 create mode 100644 changes/no_reachability_test_on_startup

diff --git a/changes/no_reachability_test_on_startup b/changes/no_reachability_test_on_startup
new file mode 100644
index 0000000..e6a57a0
--- /dev/null
+++ b/changes/no_reachability_test_on_startup
@@ -0,0 +1,6 @@
+  o Minor features:
+    - Directory authorities no longer launch a TLS connection to every
+      relay as they startup. Now that we have 2k+ descriptors cached,
+      the resulting network hiccup is becoming a burden. Besides,
+      authorities already avoid voting about Running for the first half
+      hour of their uptime.
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index ad96e76..8b21501 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -3108,8 +3108,7 @@ dirserv_single_reachability_test(time_t now, routerinfo_t *router)
                         router->cache_info.identity_digest);
 }
 
-/** Auth dir server only: if <b>try_all</b> is 1, launch connections to
- * all known routers; else we want to load balance such that we only
+/** Auth dir server only: load balance such that we only
  * try a few connections per call.
  *
  * The load balancing is such that if we get called once every ten
@@ -3117,7 +3116,7 @@ dirserv_single_reachability_test(time_t now, routerinfo_t *router)
  * bit over 20 minutes).
  */
 void
-dirserv_test_reachability(time_t now, int try_all)
+dirserv_test_reachability(time_t now)
 {
   /* XXX decide what to do here; see or-talk thread "purging old router
    * information, revocation." -NM
@@ -3140,12 +3139,11 @@ dirserv_test_reachability(time_t now, int try_all)
       continue; /* bridge authorities only test reachability on bridges */
 //    if (router->cache_info.published_on > cutoff)
 //      continue;
-    if (try_all || (((uint8_t)id_digest[0]) % 128) == ctr) {
+    if ((((uint8_t)id_digest[0]) % 128) == ctr) {
       dirserv_single_reachability_test(now, router);
     }
   } SMARTLIST_FOREACH_END(router);
-  if (!try_all) /* increment ctr */
-    ctr = (ctr + 1) % 128;
+  ctr = (ctr + 1) % 128; /* increment ctr */
 }
 
 /** Given a fingerprint <b>fp</b> which is either set if we're looking for a
diff --git a/src/or/main.c b/src/or/main.c
index 74075b6..82f6e84 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -918,7 +918,7 @@ run_scheduled_events(time_t now)
   if (now % 10 == 0 && (authdir_mode_tests_reachability(options)) &&
       !we_are_hibernating()) {
     /* try to determine reachability of the other Tor relays */
-    dirserv_test_reachability(now, 0);
+    dirserv_test_reachability(now);
   }
 
   /** 1d. Periodically, we discount older stability information so that new
@@ -1479,11 +1479,6 @@ do_main_loop(void)
   now = time(NULL);
   directory_info_has_arrived(now, 1);
 
-  if (authdir_mode_tests_reachability(get_options())) {
-    /* the directory is already here, run startup things */
-    dirserv_test_reachability(now, 1);
-  }
-
   if (server_mode(get_options())) {
     /* launch cpuworkers. Need to do this *after* we've read the onion key. */
     cpu_init();
diff --git a/src/or/or.h b/src/or/or.h
index 71a9ff7..ad863dc 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -3914,7 +3914,7 @@ void dirserv_orconn_tls_done(const char *address,
                              const char *digest_rcvd,
                              int as_advertised);
 void dirserv_single_reachability_test(time_t now, routerinfo_t *router);
-void dirserv_test_reachability(time_t now, int try_all);
+void dirserv_test_reachability(time_t now);
 int authdir_wants_to_reject_router(routerinfo_t *ri, const char **msg,
                                    int complain);
 int dirserv_would_reject_router(routerstatus_t *rs);
-- 
1.6.5



More information about the tor-commits mailing list