Bootstrap: add some extra logging

Diagnostics for 27236.
This commit is contained in:
teor 2018-08-25 01:11:44 +10:00 committed by Nick Mathewson
parent 3ebbc1c84d
commit dd27e17ccc

View File

@ -2216,9 +2216,20 @@ compute_frac_paths_available(const networkstatus_t *consensus,
count_usable_descriptors(num_present_out, num_usable_out, count_usable_descriptors(num_present_out, num_usable_out,
mid, consensus, now, NULL, mid, consensus, now, NULL,
USABLE_DESCRIPTOR_ALL); USABLE_DESCRIPTOR_ALL);
log_debug(LD_NET,
"%s: %d present, %d usable",
"mid",
np,
nu);
if (options->EntryNodes) { if (options->EntryNodes) {
count_usable_descriptors(&np, &nu, guards, consensus, now, count_usable_descriptors(&np, &nu, guards, consensus, now,
options->EntryNodes, USABLE_DESCRIPTOR_ALL); options->EntryNodes, USABLE_DESCRIPTOR_ALL);
log_debug(LD_NET,
"%s: %d present, %d usable",
"guard",
np,
nu);
} else { } else {
SMARTLIST_FOREACH(mid, const node_t *, node, { SMARTLIST_FOREACH(mid, const node_t *, node, {
if (authdir) { if (authdir) {
@ -2229,6 +2240,10 @@ compute_frac_paths_available(const networkstatus_t *consensus,
smartlist_add(guards, (node_t*)node); smartlist_add(guards, (node_t*)node);
} }
}); });
log_debug(LD_NET,
"%s: %d possible",
"guard",
smartlist_len(guards));
} }
/* All nodes with exit policy and flag */ /* All nodes with exit policy and flag */
@ -2248,17 +2263,22 @@ compute_frac_paths_available(const networkstatus_t *consensus,
CONSENSUS_PATH_EXIT : CONSENSUS_PATH_EXIT :
CONSENSUS_PATH_INTERNAL); CONSENSUS_PATH_INTERNAL);
if (have_consensus_path == CONSENSUS_PATH_INTERNAL if (old_have_consensus_path != have_consensus_path) {
&& old_have_consensus_path != have_consensus_path) { if (have_consensus_path == CONSENSUS_PATH_INTERNAL) {
log_notice(LD_NET, log_notice(LD_NET,
"The current consensus has no exit nodes. " "The current consensus has no exit nodes. "
"Tor can only build internal paths, " "Tor can only build internal paths, "
"such as paths to hidden services."); "such as paths to onion services.");
/* However, exit nodes can reachability self-test using this consensus, /* However, exit nodes can reachability self-test using this consensus,
* join the network, and appear in a later consensus. This will allow * join the network, and appear in a later consensus. This will allow
* the network to build exit paths, such as paths for world wide web * the network to build exit paths, such as paths for world wide web
* browsing (as distinct from hidden service web browsing). */ * browsing (as distinct from hidden service web browsing). */
} else if (old_have_consensus_path == CONSENSUS_PATH_INTERNAL) {
log_notice(LD_NET,
"The current consensus contains exit nodes. "
"Tor can build exit and internal paths.");
}
} }
f_guard = frac_nodes_with_descriptors(guards, WEIGHT_FOR_GUARD); f_guard = frac_nodes_with_descriptors(guards, WEIGHT_FOR_GUARD);