[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [doctor/master] Limit BadExit sync notice to authorities in the minority



commit c024edd53869602995ffcf52e9233883b4325d23
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Sun Apr 1 14:02:26 2018 -0700

    Limit BadExit sync notice to authorities in the minority
    
    When four authorites have the BadExit flag and one does not we only need to
    notify minority part (and same vice versa). Noticed thanks to Linus.
---
 consensus_health_checker.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/consensus_health_checker.py b/consensus_health_checker.py
index 13dddd4..cd809cc 100755
--- a/consensus_health_checker.py
+++ b/consensus_health_checker.py
@@ -761,7 +761,12 @@ def bad_exits_in_sync(latest_consensus, consensuses, votes):
     if not_in_vote:
       attr.append('not in vote: %s' % ', '.join(not_in_vote))
 
-    issues.append(Issue(Runlevel.NOTICE, 'BADEXIT_OUT_OF_SYNC', fingerprint = fingerprint, counts = ', '.join(attr), to = bad_exits.keys()))
+    # Notify whoever doesn't match the consensus, and as such are in the minority.
+
+    has_flag_in_consensus = Flag.BADEXIT in latest_consensus.routers[fingerprint].flags
+    notice_for = without_flag if has_flag_in_consensus else with_flag
+
+    issues.append(Issue(Runlevel.NOTICE, 'BADEXIT_OUT_OF_SYNC', fingerprint = fingerprint, counts = ', '.join(attr), to = notice_for))
 
   return issues
 

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits