Bug 40876: Extra logging

This commit is contained in:
Mike Perry 2023-10-25 00:55:43 +00:00
parent d7f14a54fb
commit 6bfadc7a5d

View File

@ -2193,6 +2193,10 @@ select_primary_guard_for_circuit(guard_selection_t *gs,
* one from the list. */
if (num_entry_guards_considered >= num_entry_guards_to_consider) {
break;
}
} else {
log_info(LD_GUARD, "Guard %s is not reachable",
entry_guard_describe(guard));
}
} SMARTLIST_FOREACH_END(guard);
@ -2202,6 +2206,10 @@ select_primary_guard_for_circuit(guard_selection_t *gs,
"Selected primary guard %s for circuit from a list size of %d.",
entry_guard_describe(chosen_guard),
smartlist_len(usable_primary_guards));
/* Describe each guard in the list: */
SMARTLIST_FOREACH_BEGIN(usable_primary_guards, entry_guard_t *, guard) {
log_info(LD_GUARD, " %s", entry_guard_describe(guard));
} SMARTLIST_FOREACH_END(guard);
smartlist_free(usable_primary_guards);
}
@ -2307,16 +2315,22 @@ select_entry_guard_for_circuit(guard_selection_t *gs,
/* "If any entry in PRIMARY_GUARDS has {is_reachable} status of
<maybe> or <yes>, return the first such guard." */
chosen_guard = select_primary_guard_for_circuit(gs, usage, rst, state_out);
if (chosen_guard)
if (chosen_guard) {
log_info(LD_GUARD, "Selected primary guard %s for circuit.",
entry_guard_describe(chosen_guard));
return chosen_guard;
}
/* "Otherwise, if the ordered intersection of {CONFIRMED_GUARDS}
and {USABLE_FILTERED_GUARDS} is nonempty, return the first
entry in that intersection that has {is_pending} set to
false." */
chosen_guard = select_confirmed_guard_for_circuit(gs, usage, rst, state_out);
if (chosen_guard)
if (chosen_guard) {
log_info(LD_GUARD, "Selected confirmed guard %s for circuit.",
entry_guard_describe(chosen_guard));
return chosen_guard;
}
/* "Otherwise, if there is no such entry, select a member
* {USABLE_FILTERED_GUARDS} following the sample ordering" */
@ -2329,6 +2343,8 @@ select_entry_guard_for_circuit(guard_selection_t *gs,
return NULL;
}
log_info(LD_GUARD, "Selected filtered guard %s for circuit.",
entry_guard_describe(chosen_guard));
return chosen_guard;
}