Changes between Version 1 and Version 2 of Ticket #13603, comment 10


Ignore:
Timestamp:
Dec 3, 2014, 10:18:19 PM (5 years ago)
Author:
toralf
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #13603, comment 10

    v1 v2  
    1 I tried
     1with the script below I realized today within 11 minutes 351 closed ORconnections, 71 with reason DONE, but 277 with reason IOERROR
    22{{{
    3 FetchDirInfoEarly 1
    4 FetchDirInfoExtraEarly 1
    5 FetchUselessDescriptors 1
    6 UseMicrodescriptors 0
    7 DownloadExtraInfo 1
     3#!/usr/bin/python2
     4
     5import time
     6import functools
     7
     8from stem import ORStatus, ORClosureReason
     9from stem.control import EventType, Controller
     10
     11global i_done
     12global i_closed
     13global i_ioerror
     14i_done = 0
     15i_closed = 0
     16i_ioerror = 0
     17
     18def main():
     19  with Controller.from_port() as controller:
     20    controller.authenticate()
     21
     22    orconn_listener = functools.partial(orconn_event, controller)
     23    controller.add_event_listener(orconn_listener, EventType.ORCONN)
     24
     25    raw_input()
     26
     27def orconn_event(controller, event):
     28  global i_done
     29  global i_closed
     30  global i_ioerror
     31 
     32  if event.status == ORStatus.CLOSED:
     33    i_closed += 1
     34 
     35    if event.reason == ORClosureReason.DONE:
     36      i_done += 1
     37     
     38    if event.reason == ORClosureReason.IOERROR:
     39      i_ioerror += 1
     40      fingerprint = event.endpoint_fingerprint
     41
     42      try:
     43        relay = controller.get_network_status(fingerprint)
     44        print " %i %i %i %i %s %s %15s %5i %s %s" % (i_closed, i_done, i_ioerror, event.arrived_at, time.ctime(event.arrived_at), fingerprint, relay.address, relay.or_port, controller.get_info("ip-to-country/%s" % relay.address, 'unknown'), relay.nickname)
     45      except Exception as exc:
     46        print " %i %i %i %i %s %s"                % (i_closed, i_done, i_ioerror, event.arrived_at, time.ctime(event.arrived_at), fingerprint)
     47
     48if __name__ == '__main__':
     49  main()
    850}}}
    9 in torrc and reloaded the tor process, but still get (till now):
    10 {{{
    11 Unable to retrieve get_network_status from fingerprint: C8A8C8E7FA6F936C1ED0ACBAC0BD8F1D3394C181 GETINFO request contained unrecognized keywords: ns/id/C8A8C8E7FA6F936C1ED0ACBAC0BD8F1D3394C181
    12 }}}
    13 with this small change to my script :
    14 {{{
    15     try:
    16       relay = controller.get_network_status(fingerprint)
    17       print " %i %s %15s %5i %s %s %s" % (event.arrived_at, time.ctime(event.arrived_at), relay.address, relay.or_port, fingerprint, controller.get_info("ip-to-country/%s" % relay.address, 'unknown'), relay.nickname)
    18     except Exception as exc:
    19       print "Unable to retrieve get_network_status from fingerprint: %s %s" % (fingerprint, exc)
    20 }}}
    21 Maybe I have to wait a little bit longer till tor has fetched all infos ?
    22 
    23 But in general, yes, a better error explanation about missing descriptor info would be nice :-)
     51I took a look onto the values got from ifconfig, there are no RX/TX errors so far