Skip to content
Snippets Groups Projects
Commit 4642c109 authored by juga's avatar juga
Browse files

circuitbuilder: Stop building the circuit 3 times

It is observed that when the circuit can not be built the first
time, consecutive attemps will also fail.
The relay will be measured anyway in the next iteration.
This will also speed up the scanner.
There is no need to remove the 3 attemps in Destination.
_perform_usability_test, since the method will be removed in #28897.

Fixes bug #29295. Bugfix v0.1.0.
parent 149e236e
Branches
Tags
No related merge requests found
......@@ -74,19 +74,13 @@ class CircuitBuilder:
timeout = self.circuit_timeout
fp_path = '[' + ' -> '.join([p for p in path]) + ']'
log.debug('Building %s', fp_path)
error = None
for _ in range(0, 3):
try:
circ_id = c.new_circuit(
path, await_build=True, timeout=timeout)
except (InvalidRequest, CircuitExtensionFailed,
ProtocolError, Timeout) as e:
log.debug(e)
error = str(e)
continue
else:
return circ_id, None
return None, error
try:
circ_id = c.new_circuit(
path, await_build=True, timeout=timeout)
except (InvalidRequest, CircuitExtensionFailed,
ProtocolError, Timeout) as e:
return None, str(e)
return circ_id, None
def __del__(self):
c = self.controller
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment