[tor-bugs] #3199 [Tor]: Refactor periodic events
Tor Bug Tracker & Wiki
blackhole at torproject.org
Tue Nov 17 03:56:04 UTC 2015
#3199: Refactor periodic events
-------------------------------------------------+-------------------------
Reporter: nickm | Owner:
Type: defect | Status:
Priority: Very Low | needs_review
Component: Tor | Milestone: Tor:
Severity: Normal | 0.2.8.x-final
Keywords: easy, tor-relay, | Version: Tor:
027-triaged-1-deferrable, 028-triaged, | 0.2.7
pre028-patch | Resolution:
Parent ID: | Actual Points:
Sponsor: SponsorS | Points: medium
-------------------------------------------------+-------------------------
Comment (by special):
It makes me a little sad that events like rotate_onion_key, check_ed_keys,
record_bridge_stats will be called once per second on clients to handle
the unlikely case where the configuration changes and they're now
relevant. That is consistent with previous behavior, though. They have a
little more overhead than they used to - at least one time() and
event_add() each.
It wasn't obvious what returning -1 from the callback would do, but it is
documented. A constant would help, maybe. Speaking of which:
{{{
+* interval time. If the returned value is larger than <b>now</b> then
it
+* is assumed to be a future time to poll again. */
}}}
From periodic.h:11. This comment is wrong; it will assert if a timestamp
is returned.
In periodic_event_dispatch, the log_info is done after the callback. I
think it would make more sense before.
I did not notice anything that moved and might be sensitive to being
called in a different order, but I could imagine that being very subtle.
Nitpickery:
main.c:1612 - not new, but this function is run_connection_housekeeping,
not connection_run_housekeeping.
main.c:1579 - extra space before GREEDY_DESCRIPTOR_RETRY_INTERVAL
main.c:1458 - the 3a comment is over-indented
periodic.c:15 - greate -> greater, ground -> grounds
LGTM otherwise.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/3199#comment:22>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list