[tor-bugs] #3199 [Tor]: Refactor periodic events

Tor Bug Tracker & Wiki blackhole at torproject.org
Mon Nov 2 14:12:35 UTC 2015


#3199: Refactor periodic events
-------------------------------------------------+-------------------------
 Reporter:  nickm                                |          Owner:
     Type:  defect                               |         Status:
 Priority:  Very Low                             |  needs_revision
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
-------------------------------------------------+-------------------------
Changes (by nickm):

 * status:  needs_review => needs_revision
 * severity:   => Normal


Comment:

 Notes on the design:
   * Multi-statement macros should get wrapped in `STMT_BEGIN` and
 `STMT_END`.
   * Instead of exit(0), use tor_assert(0) for bugs.
    *  `INCREMENT_DELTA_AND_TEST` is IMO a problematic interface -- having
 to get the `id` field correct is a very fragile.
    * Having relative times and absolute times _both_ be possible return
 types from event functions is also fragile IMO.
    * I'm not sure I completely understand what `run_scheduled_events` is
 doing any more -- it seems like we'd be better off finding a way to kill
 it off entirely.  I bet we can do so more easily with the refactoring that
 has already happened in `run_scheduled_events()` in the master branch.

 Notes on the patch set:
    * Needs tests!  :)

 Notes on the code movement:
    * our best strategy for merging this patch right now is probably to
 copy the infrastructure patches, clean 'em up, test 'em, and then re-do
 the code movement parts one at a time, since there has been a lot of code
 drift in run_scheduled_events() since this patch was first written.
    * with that in mind I'm not going to review the code movement piece of
 this. :)

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/3199#comment:17>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list