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

Re: [tor-bugs] #11069 [Tor]: Tor with unreachable PTs should not hang the bootstrap process



#11069: Tor with unreachable PTs should not hang the bootstrap process
------------------------+--------------------------------
     Reporter:  asn     |      Owner:
         Type:  defect  |     Status:  new
     Priority:  normal  |  Milestone:  Tor: 0.2.5.x-final
    Component:  Tor     |    Version:
   Resolution:          |   Keywords:  tor-pt tor-client
Actual Points:          |  Parent ID:
       Points:          |
------------------------+--------------------------------

Comment (by asn):

 We discussed this with nickm today, and it seems that
 `any_pending_bridge_descriptor_fetches()` is the problem. The function
 goes through the connection list and searches for open directory
 connections, and it seems that Tor opens directory connections for bridges
 which get closed after their OR connections close. So at the time of the
 function call the directory connections are still open.

 Nick suggested cycling through the OR connections instead and checking if
 there are any active ones. Apparently the OR conns are the ones that get
 marked as closed first if the bridges are not reachable (not sure why).

 I attached a patch that tries this idea and seems to work. Unfortunately,
 I don't really understand how these directory/OR connections are started
 up, so the patch might as well be wrong. I tested it by adding two
 unreachable bridges, and seeing if I get two warnings: instead I got one,
 which is what we wanted. I also tried adding two unreachable bridges and
 one reachable, and I got no warning, which is what we wanted. So from a
 behavior PoV it seems to work, but I'm not at all sure it's the correct
 fix.

 Note that I moved `connection_or_notify_error()` after
 `connection_mark_for_close_internal()` otherwise the new
 `any_pending_bridge_descriptor_fetches()` was finding itself and returning
 1. Maybe, instead of moving `connection_or_notify_error()` we should check
 that we don't find ourselves?

 Also are there any other attributes of the OR connection that we should
 look for when searching for bridge OR connections?

 BTW, it's worth mentioning that if the TBB uses this message as a hook
 that Tor cannot bootstrap, we should make sure that it only appears in
 that occasion. For example, if we have 11 bridges, and the first 10
 bridges fail but the last one is legit, this message will still appear as
 a warning because of:
 {{{
   if (bootstrap_problems >= BOOTSTRAP_PROBLEM_THRESHOLD)
     recommendation = "warn";
 }}}

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/11069#comment:7>
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