Commit 13307d9c authored by aagbsn's avatar aagbsn
Browse files

added reset_stats() to Scansupport.py

calls parent and SQLSupport reset functions
Tests show that SQLSupport.reset_all() may clear too much because
if BwAuthority calls Scansupport.reset_stats() after each speedrace()
run only the first slice is properly recorded; the rest are empty.
See: https://trac.torproject.org/projects/tor/ticket/2947
parent ef0b770e
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -260,4 +260,15 @@ class SQLScanHandler(ScanHandler):
    cond.release()
    plog("INFO", "Consensus OK")

  def reset_stats(self):
    cond = threading.Condition()
    def notlambda(this):
      cond.acquire()
      ScanHandler.reset_stats(self)
      SQLSupport.reset_all()
      cond.notify()
      cond.release()
    cond.acquire()
    self.schedule_low_prio(notlambda)
    cond.wait()
    cond.release()