summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2020-08-12 13:47:59 +0300
committerGeorge Kadianakis <desnacked@riseup.net>2020-08-12 13:47:59 +0300
commit0b1835be925382d9a508cadb1060e890a39927db (patch)
treea8980adf66afc11ee579f0df3ad150dc419179ef
parentcce39dd915fd6c98468a2565ba67f6cc0c59f4bf (diff)
parent5a1918d7e748c7ef2c95b54e29b171caae30f453 (diff)
downloadtor-0b1835be925382d9a508cadb1060e890a39927db.tar.gz
tor-0b1835be925382d9a508cadb1060e890a39927db.zip
Merge branch 'maint-0.4.4' into release-0.4.4
-rw-r--r--changes/bug400835
-rw-r--r--src/feature/relay/relay_periodic.c5
2 files changed, 9 insertions, 1 deletions
diff --git a/changes/bug40083 b/changes/bug40083
new file mode 100644
index 0000000000..db26017664
--- /dev/null
+++ b/changes/bug40083
@@ -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.
diff --git a/src/feature/relay/relay_periodic.c b/src/feature/relay/relay_periodic.c
index 08ad110cf6..bfe12cd0b0 100644
--- a/src/feature/relay/relay_periodic.c
+++ b/src/feature/relay/relay_periodic.c
@@ -152,6 +152,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)
/* also, check religiously for reachability, if it's within the first
* 20 minutes of our uptime. */
@@ -162,7 +165,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