[tor-commits] [fallback-scripts/master] update: Make descriptor downloading more reliable
teor at torproject.org
teor at torproject.org
Mon Jan 20 05:55:55 UTC 2020
commit 19f54865f3c4e52cb36df65f5d4c86b8e363abad
Author: teor <teor at torproject.org>
Date: Mon Jan 20 15:22:48 2020 +1000
update: Make descriptor downloading more reliable
Retry 3 times, and wait for a 30 second timeout.
Part of 32959.
---
updateFallbackDirs.py | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/updateFallbackDirs.py b/updateFallbackDirs.py
index c2e63cf..90d5bb6 100755
--- a/updateFallbackDirs.py
+++ b/updateFallbackDirs.py
@@ -2016,7 +2016,19 @@ class CandidateList(dict):
# returns an empty list on exception
@staticmethod
def get_fallback_descriptors_once(fingerprint_list):
- desc_list = get_server_descriptors(fingerprints=fingerprint_list).run(suppress=True)
+ found_list = []
+ desc_list = []
+ desc_query = get_server_descriptors(
+ fingerprint_list,
+ retries=3,
+ timeout=30)
+ for desc in desc_query.run(suppress=True):
+ assert desc.fingerprint in fingerprint_list
+ # Skip duplicates on retries
+ if desc.fingerprint in found_list:
+ continue
+ found_list.append(desc.fingerprint)
+ desc_list.append(desc)
return desc_list
# try up to max_retries times to get the descriptors for fingerprint_list
More information about the tor-commits
mailing list