do notice-level log when we resume having enough dir info

we do a notice-level log when we decide we *don't* have enough dir
info, but in 0.3.5.1-alpha (see commit eee62e13d9, #14950) we lost our
corresponding notice-level log when things come back.

bugfix on 0.3.5.1-alpha; fixes bug 40496.
This commit is contained in:
Roger Dingledine 2021-10-23 05:24:29 -04:00
parent db34f6c9e8
commit f9cb7e3398
2 changed files with 14 additions and 2 deletions

6
changes/bug40496 Normal file
View File

@ -0,0 +1,6 @@
o Minor bugfixes (logging):
- When we no longer have enough directory information to use the
network, we would log a notice-level message -- but we would not
reliably log a message when we recovered and resumed using the
network. Now make sure there is always a corresponding message
about recovering. Fixes bug 40496; bugfix on 0.3.5.1-alpha.

View File

@ -2820,6 +2820,7 @@ update_router_have_minimum_dir_info(void)
const networkstatus_t *consensus =
networkstatus_get_reasonably_live_consensus(now,usable_consensus_flavor());
int using_md;
static int be_loud_when_things_work_again = 0;
if (!consensus) {
if (!networkstatus_get_latest_consensus())
@ -2875,8 +2876,9 @@ update_router_have_minimum_dir_info(void)
if (res && !have_min_dir_info) {
control_event_client_status(LOG_NOTICE, "ENOUGH_DIR_INFO");
control_event_boot_dir(BOOTSTRAP_STATUS_ENOUGH_DIRINFO, 0);
log_info(LD_DIR,
"We now have enough directory information to build circuits.");
tor_log(be_loud_when_things_work_again ? LOG_NOTICE : LOG_INFO, LD_DIR,
"We now have enough directory information to build circuits.");
be_loud_when_things_work_again = 0;
}
/* If paths have just become unavailable in this update. */
@ -2885,6 +2887,10 @@ update_router_have_minimum_dir_info(void)
tor_log(quiet ? LOG_INFO : LOG_NOTICE, LD_DIR,
"Our directory information is no longer up-to-date "
"enough to build circuits: %s", dir_info_status);
if (!quiet) {
/* remember to do a notice-level log when things come back */
be_loud_when_things_work_again = 1;
}
/* a) make us log when we next complete a circuit, so we know when Tor
* is back up and usable, and b) disable some activities that Tor