[tor-bugs] #20695 [Metrics/CollecTor]: handle json reading exception instead of escalating

Tor Bug Tracker & Wiki blackhole at torproject.org
Thu Nov 17 17:34:29 UTC 2016


#20695: handle json reading exception instead of escalating
-------------------------------+---------------------------------
 Reporter:  iwakeh             |          Owner:  iwakeh
     Type:  defect             |         Status:  needs_review
 Priority:  Medium             |      Milestone:  CollecTor 1.2.0
Component:  Metrics/CollecTor  |        Version:
 Severity:  Normal             |     Resolution:
 Keywords:                     |  Actual Points:
Parent ID:                     |         Points:
 Reviewer:                     |        Sponsor:
-------------------------------+---------------------------------
Changes (by iwakeh):

 * status:  accepted => needs_review
 * milestone:   => CollecTor 1.2.0


Comment:

 Please review the two commits on top of
 [https://gitweb.torproject.org/user/iwakeh/collector.git/?h=task-20695
 this branch].

 Reasoning:
 When there is a RuntimeException it will be most likely from a parsing
 failure (IOE is caught separately).  As CollecTor writes this file such a
 problem can only be due to earlier writing problems (e.g. the heap space)
 or manual editing or some other external change to the file.  Thus,
 erasing it seems the best option.

 The argument free constructor for
 [https://gitweb.torproject.org/user/iwakeh/collector.git/tree/src/main/java/org/torproject/collector/relaydescs/ReferenceChecker.java?h=task-20695&id=b71d83bc49bf6a6e28f52327e8bd879042998a74#n106
 Reference] was necessary on order to prevent the following complaint from
 Gson: `Unable to invoke no-args constructor for class
 org.torproject.collector.relaydescs.ReferenceChecker$Reference.`
 (I don't know why this didn't cause a problem elsewhere.  I'm using the
 libs distributed with release 1.1.0)

 Also add this to milestone 1.2.0.  Shouldn't the already released
 milestones be closed?

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


More information about the tor-bugs mailing list