Merge branch 'bug40083_035' into bug40083_042

Fixes conflicts due to code movement.
This commit is contained in:
Nick Mathewson 2020-08-04 13:10:16 -04:00
commit 08de260682
2 changed files with 9 additions and 1 deletions

5
changes/bug40083 Normal file
View File

@ -0,0 +1,5 @@
o Minor bugfixes (relay, self-testing):
- When starting up as a relay, if we haven't been able to verify that
we're reachable, only launch reachability tests at most once a minute.
Previously, we had been launching tests up to once a second, which
was needlessly noisy. Fixes bug 40083; bugfix on 0.2.8.1-alpha.

View File

@ -150,6 +150,9 @@ check_for_reachability_bw_callback(time_t now, const or_options_t *options)
{ {
/* XXXX This whole thing was stuck in the middle of what is now /* XXXX This whole thing was stuck in the middle of what is now
* XXXX check_descriptor_callback. I'm not sure it's right. */ * XXXX check_descriptor_callback. I'm not sure it's right. */
/** How often should we consider launching reachability tests in our first
* TIMEOUT_UNTIL_UNREACHABILITY_COMPLAINT seconds? */
#define EARLY_CHECK_REACHABILITY_INTERVAL (60)
/* also, check religiously for reachability, if it's within the first /* also, check religiously for reachability, if it's within the first
* 20 minutes of our uptime. */ * 20 minutes of our uptime. */
@ -160,7 +163,7 @@ check_for_reachability_bw_callback(time_t now, const or_options_t *options)
router_do_reachability_checks(1, dirport_reachability_count==0); router_do_reachability_checks(1, dirport_reachability_count==0);
if (++dirport_reachability_count > 5) if (++dirport_reachability_count > 5)
dirport_reachability_count = 0; dirport_reachability_count = 0;
return 1; return EARLY_CHECK_REACHABILITY_INTERVAL;
} else { } else {
/* If we haven't checked for 12 hours and our bandwidth estimate is /* If we haven't checked for 12 hours and our bandwidth estimate is
* low, do another bandwidth test. This is especially important for * low, do another bandwidth test. This is especially important for