aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-05-11 12:09:00 -0400
committerNick Mathewson <nickm@torproject.org>2012-05-11 12:09:00 -0400
commit6757261e8f8b8b2f79a07122a2324654d5fbb1b9 (patch)
tree71cf5485ca5ae19f167423c212d57abad53ef78c
parente0655708a20069a5f42476a25d62e9d3f8138d8c (diff)
downloadtor-6757261e8f8b8b2f79a07122a2324654d5fbb1b9.tar.gz
tor-6757261e8f8b8b2f79a07122a2324654d5fbb1b9.zip
Raise thresholds for declaring bootstrapping complete.
This patch changes the total serverdesc threshold from 25% to 75% and the exit threshold from 33% to 50%. The goal is to make initially constructed circuits less horrible, and to make initial less awful (since fetching directory information in parallel with whatever the user is trying to do can hurt their performance). Implements ticket 3196.
-rw-r--r--changes/bug31967
-rw-r--r--src/or/routerlist.c11
2 files changed, 16 insertions, 2 deletions
diff --git a/changes/bug3196 b/changes/bug3196
new file mode 100644
index 0000000000..9321022675
--- /dev/null
+++ b/changes/bug3196
@@ -0,0 +1,7 @@
+ o Minor features:
+ - Raise the threshold of server descriptors needed (75%) and exit
+ server descriptors needed (50%) before we will declare ourselves
+ bootstrapped. This will make clients declare completion a little
+ later, but makes the initially constructed circuits less weird
+ and less in conflict with directory connections. Fixes ticket
+ #3196.
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index a64b93f3a9..528b30fc46 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -4997,7 +4997,14 @@ update_router_have_minimum_dir_info(void)
count_usable_descriptors(&num_exit_present, &num_exit_usable,
consensus, options, now, options->ExitNodes, 1);
- if (num_present < num_usable/4) {
+/* What fraction of desired server descriptors do we need before we will
+ * build circuits? */
+#define FRACTION_USABLE_NEEDED .75
+/* What fraction of desired _exit_ server descriptors do we need before we
+ * will build circuits? */
+#define FRACTION_EXIT_USABLE_NEEDED .5
+
+ if (num_present < num_usable * FRACTION_USABLE_NEEDED) {
tor_snprintf(dir_info_status, sizeof(dir_info_status),
"We have only %d/%d usable %sdescriptors.",
num_present, num_usable, using_md ? "micro" : "");
@@ -5010,7 +5017,7 @@ update_router_have_minimum_dir_info(void)
num_present, using_md ? "micro" : "", num_present ? "" : "s");
res = 0;
goto done;
- } else if (num_exit_present < num_exit_usable / 3) {
+ } else if (num_exit_present < num_exit_usable * FRACTION_EXIT_USABLE_NEEDED) {
tor_snprintf(dir_info_status, sizeof(dir_info_status),
"We have only %d/%d usable exit node descriptors.",
num_exit_present, num_exit_usable);