commit 19f54865f3c4e52cb36df65f5d4c86b8e363abad Author: teor teor@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
tor-commits@lists.torproject.org