Opened 9 years ago

Closed 9 years ago

Last modified 7 years ago

#1981 closed defect (fixed)

when your bridges go down, you don't optimistically retry

Reported by: arma Owned by: arma
Priority: High Milestone: Tor: 0.2.2.x-final
Component: Core Tor/Tor Version:
Severity: Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

When you're using bridges, and your network goes down or your bridges go offline briefly, we should see this log line:

Sep 28 15:36:02.507 [notice] Application request when we haven't used client functionality lately. Optimistically trying known bridges again.

but it isn't happening.

Child Tickets

Change History (5)

comment:1 Changed 9 years ago by arma

The problem is that we don't ever tell ourselves that the entry guard connection has succeeded. So when learned_bridge_descriptor() says:

Sep 28 16:32:58.886 [notice] new bridge descriptor 'bridge' (fresh)

it calls

add_an_entry_guard(ri, 1);

but nothing sets entry->made_contact, which means when the network or bridge goes away and we try a connection to the bridge and fail, we get:

Sep 28 14:40:58.195 [info] entry_guard_register_connect_status(): Connection to never-contacted entry guard 'bridge' (4C17FB532E20B2A8AC199441ECD2B0177B39E4B1) failed. Removing from the list. -1/0 entry guards usable/new.

and now the entry node is gone, which means bridges_retry_helper() will say

Sep 28 15:34:43.136 [debug] bridges_retry_helper(): any_known 0, any_running 0

because there are no entry guards configured at all.

So bridges_known_but_down() returns 0.

comment:2 Changed 9 years ago by arma

Here's the fix:

diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 35d8087..d696fe1 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -4551,6 +4551,10 @@ learned_bridge_descriptor(routerinfo_t *ri, int from_cach
       add_an_entry_guard(ri, 1);
       log_notice(LD_DIR, "new bridge descriptor '%s' (%s)", ri->nickname,
                  from_cache ? "cached" : "fresh");
+      /* set entry->made_contact so if it goes down we don't drop it from
+       * our entry node list */
+      entry_guard_register_connect_status(ri->cache_info.identity_digest,
+                                          1, 0, now);
       if (first)
         routerlist_retry_directory_downloads(now);
     }

Will merge shortly.

comment:3 Changed 9 years ago by arma

This is actually a bugfix on 0.2.0.3-alpha (r10967). I'm going to merge it to maint-0.2.1 too.

comment:4 Changed 9 years ago by arma

Resolution: fixed
Status: newclosed

Merged.

comment:5 Changed 7 years ago by nickm

Component: Tor ClientTor
Note: See TracTickets for help on using tickets.