[tor-bugs] #23097 [- Select a component]: The circuit timeout prediction is not working properly

Tor Bug Tracker & Wiki blackhole at torproject.org
Thu Aug 3 20:04:42 UTC 2017


#23097: The circuit timeout prediction is not working properly
--------------------------------------+-----------------
     Reporter:  dgoulet               |      Owner:
         Type:  defect                |     Status:  new
     Priority:  Medium                |  Milestone:
    Component:  - Select a component  |    Version:
     Severity:  Normal                |   Keywords:
Actual Points:                        |  Parent ID:
       Points:                        |   Reviewer:
      Sponsor:                        |
--------------------------------------+-----------------
 During prop224 service testing (#20657), I've encountered a weird
 behavior. Tor will start closing circuits with
 `circuit_expire_old_circuits_clientside()` and then open new one for
 internal use (prediction) but set their timeout to 1 sec which leads to
 closing the circuit 30 sec later (`NewCircuitPeriod` defaults to 30 sec).

 Condensed log info:

 {{{
 Aug 03 19:59:30.000 [info] circuit_expire_old_circuits_clientside():
 Closing circuit 320 that has been unused for 27997 msec.
 Aug 03 19:59:30.000 [info] circuit_expire_old_circuits_clientside():
 Closing circuit 318 that has been unused for 29997 msec.
 Aug 03 19:59:30.000 [info] circuit_expire_old_circuits_clientside():
 Closing circuit 319 that has been unused for 28979 msec.
 Aug 03 19:59:30.000 [info] circuit_predict_and_launch_new(): Have 0 clean
 circs (0 internal), need another internal circ for my hidden service.
 Aug 03 19:59:30.000 [info] origin_circuit_new(): Circuit 321 chose an idle
 timeout of 1 based on 0 seconds of predictive building remaining.
 ...
 Aug 03 20:00:01.000 [info] circuit_expire_old_circuits_clientside():
 Closing circuit 321 that has been unused for 30991 msec.
 }}}

 So notice the circuit 321 with a timeout of 1 sec and then being closed 30
 sec later... Basically, it's looping like that non stop.

 What I think is happening is this:

 1) `predicted_ports_prediction_time_remaining()` returns 0 so this
 computation always results in 1 sec (in `

 {{{
     int prediction_time_remaining =
       predicted_ports_prediction_time_remaining(time(NULL));
     circ->circuit_idle_timeout = prediction_time_remaining+1+
         crypto_rand_int(1+prediction_time_remaining/20);

 }}}

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


More information about the tor-bugs mailing list