[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-bugs] #13663 [Torflow]: silent failure when scan-data directories don't exist



#13663: silent failure when scan-data directories don't exist
--------------------------------------------+------------------------
 Reporter:  micah                           |          Owner:  aagbsn
     Type:  defect                          |         Status:  new
 Priority:  normal                          |      Milestone:
Component:  Torflow                         |        Version:
 Keywords:  bwauthority_child, bwauthority  |  Actual Points:
Parent ID:                                  |         Points:
--------------------------------------------+------------------------
 I ran the bwauthority scripts for several days and watched it pull files
 and write to log files and wonder why the aggregation wasn't getting any
 nodes at all.

 Eventually, tired of waiting with no clue, I took a dive into the code and
 found that it was wanting to write to the out_dir configured directory in
 each scanner.*/bwauthority.cfg, and I didn't have that directory. I'm
 surprised that things just kept going without an error, but I was more
 surprised that this wasn't handled in the code.

 I think something like the following would be a trivial change to make
 this not be a problem for people in the future:

 {{{
 diff --git a/NetworkScanners/BwAuthority/bwauthority_child.py
 b/NetworkScanners/BwAuthority/bwauthority_child.py
 index 28b89c2..296662a 100755
 --- a/NetworkScanners/BwAuthority/bwauthority_child.py
 +++ b/NetworkScanners/BwAuthority/bwauthority_child.py

  # Do NOT modify this object directly after it is handed to PathBuilder
 @@ -210,6 +210,12 @@ def speedrace(hdlr, start_pct, stop_pct,
 circs_per_node, save_every, out_dir,

    attempt = 0
    successful = 0
 +
 +  # make sure necessary out_dir directory exists
 +  dir = os.getcwd()+'/'+out_dir
 +  if not os.path.exists(dir):
 +    os.makedirs(dir)
 +
    while True:
      if hdlr.is_count_met(circs_per_node, successful): break
      hdlr.wait_for_consensus()
 }}}

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/13663>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs