[tor-bugs] #2716 [Tor Directory Authority]: When we conclude a relay is unreachable, we give it free uptime
Tor Bug Tracker & Wiki
torproject-admin at torproject.org
Sat Mar 12 05:00:05 UTC 2011
#2716: When we conclude a relay is unreachable, we give it free uptime
-------------------------------------+--------------------------------------
Reporter: arma | Owner:
Type: defect | Status: needs_review
Priority: normal | Milestone: Tor: 0.2.2.x-final
Component: Tor Directory Authority | Version:
Keywords: | Parent:
Points: | Actualpoints:
-------------------------------------+--------------------------------------
Comment(by nickm):
The logic in dirserv_set_router_is_running really needs a comment; it is
fairly subtle. (In fact, I wasn't sure it was right till I verified that
yes, we do keep launching reachability tests to routers even if we're
already connected to them.)
Multiplying by ten to define REACHABILITY_TEST_PERIOD then dividing by
REACHABILITY_TEST_PERIOD to recover "10" seems iffy. The 10 should
probably be a constant too.
While we're touching this, some other cleanups I'd suggest:
REACHABILITY_MODULO_PER_TEST should probably turn into a maximum number of
relays to test at a time, not a maximum fraction of the keyspace.
The code in main.c that invokes dirserv_test_reachability() uses an "if
now % interval == 0" pattern that can skip intervals if we miss a second
or double-up if we trigger twice in a second (less likely). Elsewhere we
use "if (last_did_foo + foo_interval < now) { last_did_foo = now; ... }"
as our periodic timer pattern in that function.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/2716#comment:4>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list