[tor-commits] [doctor/master] Skipping initial vote download for non-voting authorities

atagar at torproject.org atagar at torproject.org
Mon Oct 14 15:21:35 UTC 2013


commit 1bfbc46b72848adf1bc8c11822bf2a047d9f3f90
Author: Damian Johnson <atagar at torproject.org>
Date:   Mon Oct 14 08:21:45 2013 -0700

    Skipping initial vote download for non-voting authorities
    
    Huh. Code around this was a little odd, we were trying to download votes from
    non-voting authorities once then short circuiting on the retry. Perfectly fine,
    just a little odd.
---
 consensus_health_checker.py |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/consensus_health_checker.py b/consensus_health_checker.py
index 734c5ea..02149da 100755
--- a/consensus_health_checker.py
+++ b/consensus_health_checker.py
@@ -575,6 +575,9 @@ def _get_documents(label, resource):
   queries, documents, issues = {}, {}, []
 
   for authority in DIRECTORY_AUTHORITIES.values():
+    if label == 'vote' and authority.v3ident is None:
+      continue  # not a voting authority
+
     queries[authority.nickname] = downloader.query(
       resource,
       endpoints = [(authority.address, authority.dir_port)],
@@ -585,14 +588,11 @@ def _get_documents(label, resource):
     try:
       documents[authority] = query.run()[0]
     except Exception, exc:
-      if label == 'vote' and authority in DIRECTORY_AUTHORITIES:
+      if label == 'vote':
         # try to download the vote via the other authorities
 
         v3ident = DIRECTORY_AUTHORITIES[authority].v3ident
 
-        if v3ident is None:
-          continue  # not a voting authority
-
         query = downloader.query(
           '/tor/status-vote/current/%s' % v3ident,
           default_params = False,



More information about the tor-commits mailing list