Opened 11 months ago

Closed 10 months ago

Last modified 3 months ago

#24486 closed defect (not a bug)

Mark all bridges as up on application activity

Reported by: teor Owned by:
Priority: Medium Milestone: Tor: 0.3.2.x-final
Component: Core Tor/Tor Version: Tor: 0.3.2.1-alpha
Severity: Normal Keywords: regression, tor-bridge-client, s8-errors
Cc: brade, mcs, nickm, asn, catalyst Actual Points:
Parent ID: #24367 Points: 0.5
Reviewer: Sponsor:

Description (last modified by teor)

If circuit_get_open_circ_or_launch() or its callers don't already mark all bridges as up, we should make them do so.

A good way to do this is to:

  • modify the bridge state so we're using the bootstrapping schedule, then
  • reset the download statuses on all bridges, and
  • reset the guard state on all the bridges (?).

Child Tickets

Change History (8)

comment:2 Changed 11 months ago by teor

We want to handle this case better:

diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index aa0df95..8c9859b 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -2084,7 +2084,7 @@ circuit_get_open_circ_or_launch(entry_connection_t *conn,
                "used client functionality lately" :
                "received a consensus with exits",
                options->UseBridges ? "bridges" : "entrynodes");
-      } else if (!options->UseBridges || any_bridge_descriptors_known()) {
+      } else if (!options->UseBridges || num_bridges_usable() > 0) {
         log_fn(severity, LD_APP|LD_DIR,
                "Application request when we haven't %s. "
                "Optimistically trying directory fetches again.",

comment:3 Changed 11 months ago by arma

It's not just about retrying bridge descriptor downloads. It's about being willing to use your bridges even when you previously marked them all as no-longer-running, if it's been a while and you want to try making circuits again, so long as you have a descriptor for them.

In theory there is no reason you would need to first try fetching another descriptor, when the original problem was "my network didn't work for a while and that's why I marked all my bridges down".

comment:4 Changed 11 months ago by teor

Description: modified (diff)
Summary: Retry bridge descriptor downloads on application activityMark all bridges as up on application activity

Fixed the description and title.

comment:5 Changed 10 months ago by teor

Oh, ok, so arma is half-right here. We need to count the number of configured bridges in this code, because the other choices don't do what we want:

  • using any_bridge_descriptors_known() is wrong because it counts cached bridges, and we might not have any cached descriptors, or we might have some of the wrong type
  • using num_bridges_usable() > 0 is wrong because it counts usable bridges, and we might not have any marked as usable

Now I understand this issue, I'm going to review all my changes in #24392 to make sure I chose the right function out of these three different functions.

comment:6 Changed 10 months ago by teor

I think we found the issue in #24392. But let's check.

comment:7 Changed 10 months ago by teor

Resolution: not a bug
Status: newclosed

We are now handling this case better, and the code has been merged. It turns out it was a redundant condition, so this ticket can close.

comment:8 Changed 3 months ago by teor

Cc: teor removed

Remove useless CC

Note: See TracTickets for help on using tickets.