[metrics-bugs] #33205 [Metrics/Library]: Move all parsing code out of constructors

Tor Bug Tracker & Wiki blackhole at torproject.org
Sat Feb 22 08:56:43 UTC 2020


#33205: Move all parsing code out of constructors
-----------------------------+------------------------------
 Reporter:  karsten          |          Owner:  karsten
     Type:  defect           |         Status:  needs_review
 Priority:  Medium           |      Milestone:
Component:  Metrics/Library  |        Version:
 Severity:  Normal           |     Resolution:
 Keywords:                   |  Actual Points:
Parent ID:                   |         Points:  2
 Reviewer:  irl              |        Sponsor:
-----------------------------+------------------------------
Changes (by karsten):

 * status:  needs_revision => needs_review


Comment:

 Hmm, I see your points. I don't see an easy, non-boilerplate way to either
 do the parsing on demand or throw an exception when a getter gets invoked
 before invoking the parse method. And I see how lack of doing either of
 the two could lead to confusions.

 I tried something else. I worked on another patch that only fixes the
 issue at hand with minimal code changes. With this patch descriptors are
 still being parsed as part of the constructor, but not as part of the
 superconstructor using overridable methods. I tested this patch using some
 tweaked unit tests and using metrics-test. Please review
 [https://gitweb.torproject.org/user/karsten/metrics-
 lib.git/commit/?h=task-33205-2&id=9ccb934fac5827ef663e6740f64c4e06c6cb795e
 commit 9ccb934 in my task-33205-2 branch].

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


More information about the metrics-bugs mailing list