Commit 033603a6 authored by juga's avatar juga
Browse files

fix: scanner: Retry to measure exit as exit

if it fails to be measured as entry.

Mayb closes: #40029.
parent 3a4a47d3
Pipeline #1938 passed with stage
in 72 minutes and 36 seconds
......@@ -318,6 +318,17 @@ def measure_relay(args, conf, destinations, cb, rl, relay):
# Build the circuit
circ_id, reason = cb.build_circuit(circ_fps)
if not circ_id and relay.fingerprint == circ_fps[0]:
# We detected that some exits fail to build circuits as 1st hop.
# If that's the case, try again using them as 2nd hop.
# We could reuse the helper, but it does not need to be an exit now,
# so choose other again.
helper = _pick_ideal_second_hop(
relay, dest, rl, cb.controller, is_exit=False)
if helper:
circ_fps = [helper.fingerprint, relay.fingerprint]
nicknames = [helper.nickname, relay.nickname]
circ_id, reason = cb.build_circuit(circ_fps)
if not circ_id:
log.debug('Could not build circuit with path %s (%s): %s ',
circ_fps, nicknames, reason)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment