[tor-bugs] #17590 [Tor]: Decouple connection_ap_handshake_attach_circuit from nearly everything.

Tor Bug Tracker & Wiki blackhole at torproject.org
Thu Nov 12 20:28:11 UTC 2015


#17590: Decouple connection_ap_handshake_attach_circuit from nearly everything.
-----------------------------+------------------------------------
     Reporter:  nickm        |      Owner:
         Type:  enhancement  |     Status:  new
     Priority:  Medium       |  Milestone:  Tor: 0.2.8.x-final
    Component:  Tor          |    Version:
     Severity:  Minor        |   Keywords:  blob SponsorS refactor
Actual Points:               |  Parent ID:
       Points:               |    Sponsor:
-----------------------------+------------------------------------
 Long ago we used to call connection_ap_handshake_attach_circuit() only in
 a few places, since connection_ap_attach_pending() attaches all the
 pending connections, and does so regularly.  But this turned out to have a
 performance problem: it would introduce a delay to launching or connecting
 a stream.

 We couldn't just call connection_ap_attach_pending() every time we make a
 new connection, since it walks the whole connection list.  So we started
 calling connection_ap_attach_pending all over, instead!  But that's kind
 of ugly and messes up our callgraph.

 But we have an opportunity to make Tor simpler!

   * We can make connection_ap_attach_pending() linear in the number of
 pending entry connections, rather than in the number of total connections.
   * If we do that, we can make it get called from  whenever there is a
 pending entry connection from run_main_loop_once() or somewhere.
   * And if we do that, we can just put connections on a pending-list,
 rather than calling connection_ap_attach_pending() on them directly.

 This will simplify tor, simplify our callgraph, and -- with the help of
 #17589 -- break the blob into multiple smaller strongly connected
 components.

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


More information about the tor-bugs mailing list