[tor-bugs] #32194 [Metrics/Library]: NetworkStatusEntryImpl#parseSLine (and probably other methods) is not thread-safe

Tor Bug Tracker & Wiki blackhole at torproject.org
Thu Oct 31 13:57:06 UTC 2019


#32194: NetworkStatusEntryImpl#parseSLine (and probably other methods) is not
thread-safe
-----------------------------+------------------------------
 Reporter:  karsten          |          Owner:  metrics-team
     Type:  defect           |         Status:  closed
 Priority:  High             |      Milestone:
Component:  Metrics/Library  |        Version:
 Severity:  Normal           |     Resolution:  fixed
 Keywords:                   |  Actual Points:
Parent ID:                   |         Points:
 Reviewer:  irl              |        Sponsor:
-----------------------------+------------------------------
Changes (by karsten):

 * status:  merge_ready => closed
 * resolution:   => fixed


Comment:

 Replying to [comment:2 irl]:
 > LGTM.

 Great! Merging.

 > I have noticed that the Onionoo updater is finishing very close to the
 next start time. We're seeing that sometimes it is taking too long (hence
 we get a pile of alerts from Nagios that the time is older than 2 hours,
 which get resolved quite quickly). We should be thinking about thread-
 safety in any new code to avoid this being a problem later.

 Ah, in that specific case we don't have to worry about thread-safety,
 because we're never running two Onionoo updaters at the same time. We're
 using
 [https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ScheduledExecutorService.html
 #scheduleAtFixedRate-java.lang.Runnable-long-long-
 java.util.concurrent.TimeUnit- this method] for scheduling runs. Its
 documentation says: ''"If any execution of this task takes longer than its
 period, then subsequent executions may start late, but will not
 concurrently execute."'' That doesn't mean we shouldn't be looking into
 why executions take so long. But at least that doesn't cause new trouble
 with concurrent executions.

 Closing this ticket. Thanks!

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


More information about the tor-bugs mailing list