[tor-commits] [sbws/master] new: globals: Add constants to recover destination

juga at torproject.org juga at torproject.org
Thu Mar 21 18:30:42 UTC 2019


commit 7cc6de1d9f3f5c5f750b15ae971d6297cea1b17e
Author: juga0 <juga at riseup.net>
Date:   Sat Mar 16 10:13:18 2019 +0000

    new: globals: Add constants to recover destination
    
    Part of #29589.
---
 sbws/globals.py | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/sbws/globals.py b/sbws/globals.py
index 015e857..5003973 100644
--- a/sbws/globals.py
+++ b/sbws/globals.py
@@ -122,9 +122,18 @@ HTTP_GET_HEADERS = {
 DESTINATION_VERIFY_CERTIFICATE = True
 # This number might need adjusted depending on the percentage of circuits and
 # HTTP requests failures.
-# While the scanner can not recover from some/all failing destionations,
-# set a big number so that it continues trying.
-MAXIMUM_NUMBER_DESTINATION_FAILURES = 100
+
+# Number of attempts to use a destination, that are stored, in order to decide
+# whether the destination is functional or not.
+NUM_DESTINATION_ATTEMPTS_STORED = 10
+# Time to wait before trying again a destination that wasn't functional.
+DELTA_SECONDS_RETRY_DESTINATION = 60 * 60 * 3
+# Number of consecutive times a destination can fail before considering it
+# not functional.
+MAX_NUM_DESTINATION_FAILURES = 3
+# By which factor to multiply DELTA_SECONDS_RETRY_DESTINATION when the
+# destination fail again.
+FACTOR_INCREMENT_DESTINATION_RETRY = 2
 
 
 def fail_hard(*a, **kw):





More information about the tor-commits mailing list