Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Launch early reachability tests once a minute, not once a second. #2048

Open
wants to merge 1 commit into
base: maint-0.3.5
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changes/bug40083
Original file line number Diff line number Diff line change
@@ -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.
5 changes: 4 additions & 1 deletion src/core/mainloop/mainloop.c
Original file line number Diff line number Diff line change
Expand Up @@ -2280,6 +2280,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 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)

static int dirport_reachability_count = 0;
/* also, check religiously for reachability, if it's within the first
Expand All @@ -2291,7 +2294,7 @@ check_for_reachability_bw_callback(time_t now, const or_options_t *options)
router_do_reachability_checks(1, dirport_reachability_count==0);
if (++dirport_reachability_count > 5)
dirport_reachability_count = 0;
return 1;
return EARLY_CHECK_REACHABILITY_INTERVAL;
} else {
/* If we haven't checked for 12 hours and our bandwidth estimate is
* low, do another bandwidth test. This is especially important for
Expand Down