[tor-bugs] #2766 [Torperf]: Enforce using a fresh circuit for a new Torperf run

Tor Bug Tracker & Wiki torproject-admin at torproject.org
Wed Mar 16 13:03:11 UTC 2011


#2766: Enforce using a fresh circuit for a new Torperf run
-------------------------+--------------------------------------------------
 Reporter:  karsten      |          Owner:  karsten
     Type:  enhancement  |         Status:  new    
 Priority:  minor        |      Milestone:         
Component:  Torperf      |        Version:         
 Keywords:               |         Parent:         
   Points:               |   Actualpoints:         
-------------------------+--------------------------------------------------
 Our current approach to enforce using a fresh circuit for a new Torperf
 run is that we set `MaxCircuitDirtiness` to something smaller than the
 interval at which we start new Torperf runs.  But whenever we forget to
 update this setting, Tor won't really tell us that something's wrong.  We
 only learn that when merging `.data` and `.extradata` files.

 We should switch to sending a NEWNYM signal and stop messing with
 `MaxCircuitDirtiness`.  Below is a patch that Mike wrote, but that doesn't
 really fit in entrycons.py, because not all Torperf runs use that script.
 Maybe we should apply this patch when we merge the various Python scripts
 in #2565?

 {{{
 commit 6e79ca00fb923d90e63bf10f0e3913ef6641eb5c
 Author: Mike Perry <mikeperry-git at fscked.org>
 Date:   Wed Mar 16 04:46:09 2011 -0700

     Fix entrycons.py to send a NEWNYM signal after every stream.

 diff --git a/entrycons.py b/entrycons.py
 index d1c8f34..41678fd 100755
 --- a/entrycons.py
 +++ b/entrycons.py
 @@ -16,6 +16,11 @@ class EntryTracker(TorCtl.ConsensusTracker):
      self.speed = speed
      self.set_entries()

 +  def stream_status_event(self, event):
 +    # Every time a stream closes, send a NEWNYM signal
 +    if event.status == "CLOSED" or event.status == "FAILED":
 +      self.c.send_signal("NEWNYM")
 +
    def new_consensus_event(self, n):
      TorCtl.ConsensusTracker.new_consensus_event(self, n)
      TorUtil.plog("INFO", "New consensus arrived. Rejoice!")
 @@ -120,7 +125,7 @@ def main():

    conn = TorCtl.connect(HOST, port)

 -  conn.set_events(["NEWCONSENSUS", "NEWDESC", "NS", "GUARD"])
 +  conn.set_events(["STREAM", "NEWCONSENSUS", "NEWDESC", "NS", "GUARD"])
    conn.set_option("StrictEntryNodes", "1")
    conn.set_option("UseEntryNodes", "1")
 }}}

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


More information about the tor-bugs mailing list