[tor-bugs] #24228 [Core Tor/Tor]: Tor keeps on creating new circuits even when it's idle

Tor Bug Tracker & Wiki blackhole at torproject.org
Fri Nov 10 14:52:29 UTC 2017


#24228: Tor keeps on creating new circuits even when it's idle
--------------------------+------------------------------------
 Reporter:  asn           |          Owner:  (none)
     Type:  defect        |         Status:  new
 Priority:  Medium        |      Milestone:  Tor: 0.3.3.x-final
Component:  Core Tor/Tor  |        Version:
 Severity:  Normal        |     Resolution:
 Keywords:                |  Actual Points:
Parent ID:                |         Points:
 Reviewer:                |        Sponsor:
--------------------------+------------------------------------

Comment (by dgoulet):

 Quick investigation and I think the place to look for a suspect is
 `needs_hs_client_circuits()` called by `circuit_predict_and_launch_new()`

 Seems the CBT subsystem will set the circuit idle timeout to 60 seconds as
 long as we haven't observed at least `CBT_DEFAULT_MIN_CIRCUITS_TO_OBSERVE
 = 100` circuits.

 If you look at `origin_circuit_new()`, there is basically a big if/else
 condition where the first condition is if we don't have our CBT disabled
 and if we have observed enough circuits for tor to start using the
 predicted CBT, set the idle timeout is set to 60 sec
 (`IDLE_TIMEOUT_WHILE_LEARNING`).

 So far so good but the problem comes with `needs_hs_client_circuit()` that
 wants 3 internal circuits at all time to be opened for HS "potential use".
 So every 60 sec or so (some random is added), tor will close at least one
 circuit and relaunch a new one because we need an HS circuit at that
 point.

 That is looping until we reach the 100 circuit that CBT needs to start
 using the predictable idle timeout. In other words, a tor client will
 always open new circuits after expiring idle ones. When a client boots up
 with a fresh state file, it is a loop of 100 of them ;).

 For an active client, this is a bit different but for an idle client, it
 is a constant stream of new circuits until 100 is reached.

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


More information about the tor-bugs mailing list