[tor-commits] [doctor/master] Differentiate between 'no badexit flag' and 'not in consensus'

atagar at torproject.org atagar at torproject.org
Sun Feb 21 01:56:02 UTC 2016


commit f1d40c6c736a72f9c607d5b170a0085b5f8053a0
Author: Damian Johnson <atagar at torproject.org>
Date:   Sat Feb 20 17:10:19 2016 -0800

    Differentiate between 'no badexit flag' and 'not in consensus'
    
    Authorities usually flag bad actors by either BadExit or Rejection. As such
    when we're out of sync it might be because different authorities chose
    different methods. Updating our notice to better differentiate this...
    
      https://trac.torproject.org/projects/tor/ticket/17441#comment:3
---
 consensus_health_checker.py | 21 +++++++++++++++++++--
 data/consensus_health.cfg   |  2 +-
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/consensus_health_checker.py b/consensus_health_checker.py
index e8de5bf..68fad73 100755
--- a/consensus_health_checker.py
+++ b/consensus_health_checker.py
@@ -662,9 +662,26 @@ def bad_exits_in_sync(latest_consensus, consensuses, votes):
 
   for fingerprint in disagreed_bad_exits:
     with_flag = set([authority for authority, flagged in bad_exits.items() if fingerprint in flagged])
-    without_flag = voting_authorities.difference(with_flag)
+    without_flag = []
+    not_in_consensus = []
 
-    issues.append(Issue(Runlevel.NOTICE, 'BADEXIT_OUT_OF_SYNC', fingerprint = fingerprint, with_flag = ', '.join(with_flag), without_flag = ', '.join(without_flag), to = bad_exits.keys()))
+    for authority in voting_authorities.difference(with_flag):
+      vote = votes[authority]
+
+      if fingerprint in vote.routers:
+        without_flag.append(authority)
+      else:
+        not_in_consensus.append(authority)
+
+    attr = ['with flag: %s' % ', '.join(with_flag)]
+
+    if without_flag:
+      attr.append('without flag: %s' % ', '.join(without_flag))
+
+    if not_in_consensus:
+      attr.append('not in consensus: %s' % ', '.join(not_in_consensus))
+
+    issues.append(Issue(Runlevel.NOTICE, 'BADEXIT_OUT_OF_SYNC', fingerprint = fingerprint, counts = ', '.join(attr), to = bad_exits.keys()))
 
   return issues
 
diff --git a/data/consensus_health.cfg b/data/consensus_health.cfg
index 2c5652a..6d72cac 100644
--- a/data/consensus_health.cfg
+++ b/data/consensus_health.cfg
@@ -16,7 +16,7 @@ msg MISSING_AUTHORITIES => The following authorities are missing from the consen
 msg EXTRA_AUTHORITIES => The following authorities were not expected in the consensus: {authorities}
 msg FINGERPRINT_MISMATCH => {authority} had a different fingerprint than we expected (expected: {expected}, actual: {actual})
 msg TOR_OUT_OF_DATE =>  The following authorities are an out of date version of tor: {authorities}
-msg BADEXIT_OUT_OF_SYNC => Authorities disagree about the BadExit flag for {fingerprint} (with flag: {with_flag}, without flag: {without_flag})
+msg BADEXIT_OUT_OF_SYNC => Authorities disagree about the BadExit flag for {fingerprint} ({counts})
 msg BANDWIDTH_AUTHORITIES_OUT_OF_SYNC => Bandwidth authorities have a substantially different number of measured entries: {authorities}
 msg AUTHORITY_UNAVAILABLE => Unable to retrieve the {fetch_type} from {authority} ({url}): {error}
 





More information about the tor-commits mailing list