relay: Overload state on DNS timeout is now X% over Y secs
commitde907893befdb2bf6bb0b95b183cc1f01b8a464c
authorDavid Goulet <dgoulet@torproject.org>
Tue, 19 Oct 2021 18:13:33 +0000 (19 14:13 -0400)
committerDavid Goulet <dgoulet@torproject.org>
Wed, 20 Oct 2021 13:09:25 +0000 (20 09:09 -0400)
tree2d69389904193985c5062406b3f27a653eda7ed7
parentaf48f5736aec6ae67b52bc26e3cbb74d47dd8db1
relay: Overload state on DNS timeout is now X% over Y secs

With this commit, we will only report a general overload state if we've
seen more than X% of DNS timeout errors over Y seconds. Previous
behavior was to report when a single timeout occured which is really too
small of a threshold.

The value X is a consensus parameters called
"overload_dns_timeout_scale_percent" which is a scaled percentage
(factor of 1000) so we can represent decimal points for X like 0.5% for
instance. Its default is 1000 which ends up being 1%.

The value Y is a consensus parameters called
"overload_dns_timeout_period_secs" which is the time period for which
will gather DNS errors and once over, we assess if that X% has been
reached ultimately triggering a general overload signal.

Closes #40491

Signed-off-by: David Goulet <dgoulet@torproject.org>
src/feature/nodelist/networkstatus.c
src/feature/relay/dns.c
src/feature/stats/rephist.c
src/feature/stats/rephist.h